T
Tony Johansson
Hello!
Here I have a piece of code that doesn't draw anything when I have the code
marked with 1 but works perfect when I use the code that is marked with 2.
Can somebody explain that ?
private void Form1_Paint(object sender, PaintEventArgs e)
{
1 Bitmap bm = new Bitmap(600, 600);
1 Graphics g = Graphics.FromImage(bm);
2 Graphics g = this.CreateGraphics();
Brush b = new LinearGradientBrush(new Point(1, 1), new Point(600,
600),
Color.White, Color.Red);
Point[] points = new Point[] {new Point(10,10),
new Point(77,500),
new Point(590, 100),
new Point(250,590),
new Point(300,410)};
g.FillPolygon(b, points);
g.DrawPolygon(new Pen(Color.Red, 7), points);
}
//Tony
Here I have a piece of code that doesn't draw anything when I have the code
marked with 1 but works perfect when I use the code that is marked with 2.
Can somebody explain that ?
private void Form1_Paint(object sender, PaintEventArgs e)
{
1 Bitmap bm = new Bitmap(600, 600);
1 Graphics g = Graphics.FromImage(bm);
2 Graphics g = this.CreateGraphics();
Brush b = new LinearGradientBrush(new Point(1, 1), new Point(600,
600),
Color.White, Color.Red);
Point[] points = new Point[] {new Point(10,10),
new Point(77,500),
new Point(590, 100),
new Point(250,590),
new Point(300,410)};
g.FillPolygon(b, points);
g.DrawPolygon(new Pen(Color.Red, 7), points);
}
//Tony