-
Load And Draw Bitmap
Hey im trying to load a draw a bitmap. But I don't know how to get the System.Windows.Form.PaintEventArgs?
Code:
private void Draw_Ball()
{
Image ball = new Bitmap("c:\\source\\c#\\bounce\\ball.bmp");
Graphics g = e.Graphics;
g.DrawImage( ball, new RectangleF(10, 10,
ball.Width, ball.Height) );
}
Anyone know what im doing wrong?
Thanks
-
Adapt your existing function to take a graphics parameter and then call your function from the Paint() event, passing e.graphics() into it via the new parameter.