private void CreateNewCanvas() { Canvas = new Bitmap(CanvasPanel.ClientSize.Width, CanvasPanel.ClientSize.Height); CanvasGfx = Graphics.FromImage(Canvas); CanvasGfx.Clear(Color.White); CanvasPanel.Invalidate(); }
private void PutBlock(EventArgs e) { MouseEventArgs me = (MouseEventArgs)e; int x = me.X; int y = me.Y; Rectangle rect = new Rectangle(x, y, BrushWidth, BrushHeight); CanvasGfx.FillRectangle(MainColor, rect); CanvasPanel.Invalidate(rect); }
private void BtnFill_Click(object sender, EventArgs e) { CanvasGfx.Clear(MainColor.Color); CanvasPanel.Invalidate(); }