public DrawingPanel() { InitializeDrawingPanel(); } private void InitializeDrawingPanel() { CreateNewImage(); base.Paint += new PaintEventHandler(DrawingPanel_Paint); base.Resize += new EventHandler(DrawingPanel_Resize); } void DrawingPanel_Resize(object sender, EventArgs e) { CreateNewImage(); } void DrawingPanel_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.DrawImage(BufferImage, 0, 0); g.Dispose(); } private void CreateNewImage() { BufferImage = new Bitmap(base.Width, base.Height); for (int i = 0; i < BufferImage.Height; i++) for (int j = 0; j < BufferImage.Width; j++) BufferImage.SetPixel(j, i, Color.White); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)