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); }
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); }
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); }
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); }
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; }
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); }
public EllipseTool(ToolArgs args) : base(args) { }
public ClipboardTool(ToolArgs args, ClipboardAction action) : base(args) { this.action = action; args.pictureBox.MouseClick += new MouseEventHandler(OnMouseClick); }
public RectangleTool(ToolArgs args) : base(args) { }
public PointerTool(ToolArgs args) : base(args) { args.pictureBox.Cursor = Cursors.Arrow; args.pictureBox.MouseMove += new MouseEventHandler(OnMouseMove); }
public Tool(ToolArgs args) { this.args = args; }