Example #1
1
        private void ShowImage()
        {
            string t = imageFile.FileName;
              Text = String.Format("Paint - [{0}]", t == null ? "Untitled" : new FileInfo(t).Name);

              imageBox.ClientSize = imageFile.Bitmap.Size;
              imageBox.Invalidate();
              toolArgs = new ToolArgs(imageFile.Bitmap, imageBox, pointPanel1, pointPanel2, settings);

              if (curTool != null)
            curTool.UnloadTool();
              curTool = new PointerTool(toolArgs);
              SetToolBarButtonsState(arrowBtn);
        }
Example #2
0
 public TextTool(ToolArgs args)
     : base(args)
 {
     args.pictureBox.Cursor     = Cursors.Cross;
     args.pictureBox.MouseUp   += new MouseEventHandler(OnMouseUp);
     args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
 }
Example #3
0
 public TextTool(ToolArgs args)
     : base(args)
 {
     args.pictureBox.Cursor = Cursors.Cross;
     args.pictureBox.MouseUp += new MouseEventHandler(OnMouseUp);
     args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
 }
 public RectangleToolBase(ToolArgs args)
     : base(args)
 {
     drawing = false;
     args.pictureBox.Cursor     = Cursors.Cross;
     args.pictureBox.MouseDown += new MouseEventHandler(OnMouseDown);
     args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
     args.pictureBox.MouseUp   += new MouseEventHandler(OnMouseUp);
 }
Example #5
0
 public PencilTool(ToolArgs args)
     : base(args)
 {
     drawing = false;
     args.pictureBox.Cursor = Cursors.Cross;
     args.pictureBox.MouseDown += new MouseEventHandler(OnMouseDown);
     args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
     args.pictureBox.MouseUp += new MouseEventHandler(OnMouseUp);
 }
Example #6
0
        public BrushTool(ToolArgs args, BrushToolType type)
            : base(args)
        {
            toolType = type;
            drawing  = false;

            args.pictureBox.Cursor     = Cursors.Cross;
            args.pictureBox.MouseDown += new MouseEventHandler(OnMouseDown);
            args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
            args.pictureBox.MouseUp   += new MouseEventHandler(OnMouseUp);
        }
Example #7
0
        public BrushTool(ToolArgs args, BrushToolType type)
            : base(args)
        {
            toolType = type;
              drawing = false;

              args.pictureBox.Cursor = Cursors.Cross;
              args.pictureBox.MouseDown += new MouseEventHandler(OnMouseDown);
              args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
              args.pictureBox.MouseUp += new MouseEventHandler(OnMouseUp);
        }
Example #8
0
        public FillTool(ToolArgs args)
            : base(args)
        {
            args.pictureBox.Cursor = Cursors.Cross;
              args.pictureBox.MouseClick += new MouseEventHandler(OnMouseClick);
              args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);

              Rectangle bRect = new Rectangle(new Point(0, 0), args.bitmap.Size);
              bData = args.bitmap.LockBits(bRect, ImageLockMode.ReadWrite, args.bitmap.PixelFormat);
              // pixel size in bits = image width in bytes / image width in pixels
              pixelSize = bData.Stride / bData.Width;
        }
Example #9
0
        public FillTool(ToolArgs args)
            : base(args)
        {
            args.pictureBox.Cursor      = Cursors.Cross;
            args.pictureBox.MouseClick += new MouseEventHandler(OnMouseClick);
            args.pictureBox.MouseMove  += new MouseEventHandler(OnMouseMove);

            Rectangle bRect = new Rectangle(new Point(0, 0), args.bitmap.Size);

            bData = args.bitmap.LockBits(bRect, ImageLockMode.ReadWrite, args.bitmap.PixelFormat);
            // pixel size in bits = image width in bytes / image width in pixels
            pixelSize = bData.Stride / bData.Width;
        }
Example #10
0
        private void ShowImage()
        {
            string t = imageFile.FileName;

            Text = String.Format("Paint - [{0}]", t == null ? "Untitled" : new FileInfo(t).Name);

            imageBox.ClientSize = imageFile.Bitmap.Size;
            imageBox.Invalidate();
            toolArgs = new ToolArgs(imageFile.Bitmap, imageBox, pointPanel1, pointPanel2, settings);

            if (curTool != null)
            {
                curTool.UnloadTool();
            }
            curTool = new PointerTool(toolArgs);
            SetToolBarButtonsState(arrowBtn);
        }
Example #11
0
 public EllipseTool(ToolArgs args)
     : base(args)
 {
 }
Example #12
0
 public ClipboardTool(ToolArgs args, ClipboardAction action)
     : base(args)
 {
     this.action = action;
       args.pictureBox.MouseClick += new MouseEventHandler(OnMouseClick);
 }
Example #13
0
 public RectangleTool(ToolArgs args)
     : base(args)
 {
 }
Example #14
0
 public ClipboardTool(ToolArgs args, ClipboardAction action)
     : base(args)
 {
     this.action = action;
     args.pictureBox.MouseClick += new MouseEventHandler(OnMouseClick);
 }
Example #15
0
 public PointerTool(ToolArgs args)
     : base(args)
 {
     args.pictureBox.Cursor     = Cursors.Arrow;
     args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
 }
Example #16
0
File: Tool.cs Project: nhab/Paint
 public Tool(ToolArgs args)
 {
     this.args = args;
 }
Example #17
0
 public RectangleTool(ToolArgs args)
     : base(args)
 {
 }
Example #18
0
 public PointerTool(ToolArgs args)
     : base(args)
 {
     args.pictureBox.Cursor = Cursors.Arrow;
       args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove);
 }
Example #19
0
 public EllipseTool(ToolArgs args)
     : base(args)
 {
 }
Example #20
0
 public Tool(ToolArgs args)
 {
     this.args = args;
 }