Beispiel #1
0
        /// <summary>
        /// Creates new image display form.
        /// </summary>
        /// <param name="title">Window title.</param>
        public ImageForm(string title = "")
        {
            Title = title;
            ClientSize = new Size(640, 480);

            PictureBox = new PictureBox { Image = bmp, AutoScale = true };
            Content = PictureBox;

            this.Shown += (s, e) => PictureBox.Image = bmp;
        }
        public DrawingRectangleAdorner(PictureBox pictureBox)
        {
            pictureBox.MouseDown += PictureBox_MouseDown;
            pictureBox.MouseMove += PictureBox_MouseMove;
            pictureBox.MouseUp += PictureBox_MouseUp;
            pictureBox.Paint += PictureBox_Paint;

            control = pictureBox;

            rect = RectangleF.Empty;

            Pen = new Pen(Colors.Green, 5);
        }
        public DrawingPenAdorner(PictureBox pictureBox)
        {
            pictureBox.MouseDown += PictureBox_MouseDown;
            pictureBox.MouseMove += PictureBox_MouseMove;
            pictureBox.MouseUp += PictureBox_MouseUp;
            pictureBox.Paint += PictureBox_Paint;

            control = pictureBox;

            Paths = new List<Path>();

            Pen = new Pen(Colors.Green, 10);
            Pen.LineCap = PenLineCap.Round;
            Pen.LineJoin = PenLineJoin.Round;
        }