예제 #1
0
 private void CreateNewCanvas()
 {
     Canvas    = new Bitmap(CanvasPanel.ClientSize.Width, CanvasPanel.ClientSize.Height);
     CanvasGfx = Graphics.FromImage(Canvas);
     CanvasGfx.Clear(Color.White);
     CanvasPanel.Invalidate();
 }
예제 #2
0
        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);
        }
예제 #3
0
 private void BtnFill_Click(object sender, EventArgs e)
 {
     CanvasGfx.Clear(MainColor.Color);
     CanvasPanel.Invalidate();
 }