예제 #1
0
파일: Drawer.cs 프로젝트: Temirbay/Projects
        public Drawer (PictureBox p)
        {
            picture = p;
            b = new Bitmap(picture.Width, picture.Height);
            pen = new Pen(Color.Blue);
            raser = new Pen(Color.White, 5);

            used = new bool[picture.Width+1, picture.Height+1];
            g = Graphics.FromImage(b);
            picture.Image = b;

            shape = Shape.Pencil;

            picture.Paint += Picture_Paint;

            OpenImage("");
        }
예제 #2
0
파일: Form1.cs 프로젝트: Lyffik/OOP_Laba2
 private void pictureBox_MouseClick(object sender, MouseEventArgs e)
 {
     if (drawing)
     {
         shape.AddPoint(e.Location);
     }
     else
     {
         shape = (Shape)Activator.CreateInstance(shapes[ShapePicker.SelectedItem.ToString()]);
         shapeList.AddShape(shape);
         shape.AddPoint(e.Location);
         shape.AddPoint(e.Location);
         drawing = true;
     }
 }