Transform.Lib/Controls/Canvas.cs

(开头部分) 7KB

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

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

namespace YLScsDrawing.Controls
{
    public partial class Canvas : UserControl
    {
        public Canvas()
        {
            InitializeComponent();

            // Set the value of the double-buffering style bits to true.
            SetStyle(ControlStyles.AllPaintingInWmPaint |
              ControlStyles.UserPaint | ControlStyles.ResizeRedraw |
              ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
        }

        YLScsDrawing.Imaging.Filters.FreeTransform filter = new YLScsDrawing.Imaging.Filters.FreeTransform();
        RectangleF[] recthandle = new RectangleF[4];
        PointF[] vertex = new PointF[4];

        Rectangle originalCanvas = new Rectangle(0, 0, 400, 600);
        public Size CanvasSize
        {
            set { originalCanvas.Size = value; setup(); }
            get { return originalCanvas.Size; }
        }

        Color canvasBackColor = Color.Transparent;
        public Color CanvasBackColor
        {
            set { canvasBackColor = value; Invalidate(); }
            get { return canvasBackColor; }
        }

        float zoomFactor = 1f;
        public float ZoomFactor
        {
            get { return zoomFactor; }
            set
            {
                zoomFactor = Math.Max(0.001f, value); // if =0, tranform matrix will be thrown exception
                setup();
            }
        }

        public bool IsBilinearInterpolation
        {
            set { filter.IsBilinearInterpolation = value; }
            get { return filter.IsBilinearInterpolation; }
        }

        Bitmap pictureItem;
        public Bitmap CanvasImage
        {
            set
后面还有 161 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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