Ejemplo n.º 1
0
        public void ProcessMouseDown(Bitmap bm, Graphics gra, Point old, Point cur)
        {
            if (!pickerActive)
            {
                switch (selBrush.getBrush())
                {
                case 0: //marker
                    ModifyComponents.Graphics(gra);
                    color  = Color.FromArgb(MarProp.Opacity, colorPanel.getColor1());
                    marker = new Marker(color, MarProp.Thickness * Form1.current.SketchBoxWidth() / Form1.current.NormalWidth());
                    marker.MouseDown(ref gra, cur, ref _pts);
                    points = _pts.ToArray();
                    break;

                case 1: //eraser
                    gra.CompositingMode = CompositingMode.SourceCopy;
                    eraser = new Eraser(EraProp.Thickness * Form1.current.SketchBoxWidth() / Form1.current.NormalWidth());
                    eraser.MouseDown(ref gra, cur, ref _pts);
                    points = _pts.ToArray();
                    break;

                case 2: //fill
                    Color pointColor = Color.FromArgb(255, bm.GetPixel(old.X, old.Y));
                    color = Color.FromArgb(FillProp.Opacity, colorPanel.getColor2());
                    FillBucket.Fill(bm, old, pointColor, color);
                    break;

                case 3:
                    ModifyComponents.Graphics(gra);
                    color  = Color.FromArgb(PelProp.Opacity, colorPanel.getColor1());
                    pencil = new Pencil(color, PelProp.Thickness * Form1.current.SketchBoxWidth() / Form1.current.NormalWidth());
                    pencil.MouseDown(ref gra, cur, ref _pts);
                    points = _pts.ToArray();
                    break;

                case 4:
                    color   = Color.FromArgb(SprProp.Opacity, colorPanel.getColor1());
                    sprayer = new Sprayer();
                    sprayer.StartSpraying(gra, SprProp.Thickness * Form1.current.SketchBoxWidth() / Form1.current.NormalWidth(), cur, color);
                    break;

                case 5:
                    ModifyComponents.Graphics(gra);
                    color       = Color.FromArgb(CalliProp.Opacity, colorPanel.getColor1());
                    calligraphy = new CalligraphyPen(color, CalliProp.Thickness * Form1.current.SketchBoxWidth() / Form1.current.NormalWidth());
                    calligraphy.MouseDown(ref gra, cur, ref _pts);
                    points = _pts.ToArray();
                    break;
                }
            }
        }