Form1.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Collections;

namespace 画图
{
    public partial class Form1 : Form
    {
        Point Spt,Ept,Mpt,Fpt;//保存其实与结束鼠标坐标
        bool CursorD,TwoClick,DoubleClick;//判断鼠标是否按下
        Graphics g;
        Bitmap img;
        ArrayList Line = new ArrayList();
        public Form1()
        {
            InitializeComponent();
            StartDraw();
            CursorD = false;
            TwoClick = false;
            DoubleClick = false;
        }

        // 下载于www.51aspx.com
        private void StartDraw()
        {
            img = new Bitmap(500,500);
            g = Graphics.FromImage(img);
            g.Clear(Color.White);
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        { 
           
            e.Graphics.DrawImage(img,new Point(0,0));
            if (radioButton1.Checked)//画线
            {
                if (CursorD)
                {
                    OnPaintLine(Ept);
                }
            }
            if (radioButton2.Checked)//画直线
            {
                if (CursorD)
                {
                    e.Graphics.DrawLine(new Pen(Color.Red), Spt, Ept);
                }
            }
            if (radioButton3.Checked)//画矩形
            {
                if (CursorD)
                {
                    e.Graphics.DrawRectangle(new Pen(Color.Red), Spt.X,Spt.Y, Ept.X-Spt.X,Ept.Y-Spt.Y);
                    if (Ept.X < Spt.X && Ept.Y < Spt.Y)
后面还有 206 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。