pppaint-master/PP.PaintLib/DrawBoard.cs

(开头部分) 12KB

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

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PP.PaintLib
{
    public class DrawBoard:IDisposable
    {
        /// <summary>
        /// 构造函数:初始化画板
        /// </summary>
        /// <param name="picBox">传入作为画板的控件:PictureBox</param>
        public DrawBoard(PictureBox picBox)
        {
            if (picBox != null)
            {
                if(picBox.Image!=null)
                {
                    image = picBox.Image;
                }
                else image = new Bitmap(picBox.Width, picBox.Height);
                this.picBox = picBox;
            }
        }


        #region 私有属性

        /// <summary>
        /// 绘图图形
        /// </summary>
        private ShapeType shapeType { get; set; } = ShapeType.Line;

        /// <summary>
        /// 绘图工具
        /// </summary>
        private ToolType toolType { get; set; } = ToolType.Pencil;

        /// <summary>
        /// 画笔
        /// </summary>
        private Pen pen = new Pen(Color.Black, 1);

        /// <summary>
        /// 起点、终点
        /// </summary>
        private Point startPoint = Point.Empty, endPoint = Point.Empty;

        /// <summary>
        /// 创建一个Image对象,用于绘制图像
        /// </summary>
        private Image image = null;

        /// <summary>
        /// 画布原型
后面还有 341 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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