Currently I'm trying to do what I thought would be a simple task:
Draw an image onto the full area of a
The image to draw looks like this:
I.e. a yellow box with an 1 pixel blue frame around.
To draw, I'm using the
private void panel1_Paint(object sender, PaintEventArgs e)
base.DoubleBuffered = true;
The reason for the artefacts is that the entire surface isn't redrawn when the form is resized; only the necessary parts are. The generally best solution is what you don't want to do, calling
Invalidate on each resize. However, if this is in fact your situation, just use a
PictureBox instead. If it's not, you might consider overriding
OnPaint in your form instead, and using
this.SetStyle(ControlStyles.ResizeRedraw, true) to do this automatically.