Results 1 to 2 of 2

Thread: Load And Draw Bitmap

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    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

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    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.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width