PDA

Click to See Complete Forum and Search --> : (About GDI+) How to clear the image printed by Graphics.DrawImage()


megarfield
Mar 2nd, 2003, 03:37 AM
How can I clear the image which is printed by the "Graphics.DrawImage()" on the form.
Dim gra As Graphics
gra = Me.CreateGraphics()
Dim path As String
path = "e:\test2.bmp"
Dim picture As Image
picture = New Bitmap(path)
gra.DrawImage(picture, 0, 0)

I just want to erase the picture(test2.bmp) on the form.
And I dooooooon't want to use me.refresh(), because it's in a very low efficiency.

please give me the right code! Thanks very much!

Lunatic3
Mar 2nd, 2003, 12:01 PM
Try Me.Invalidate and tell me its efficacy in comparison to Me.Refresh

megarfield
Mar 4th, 2003, 09:20 AM
the efficency is quite the same
thank you anyway

Hu Flung Dung
Mar 4th, 2003, 03:12 PM
me.refresh seems pretty efficient on my system (1.4 GHz p4). I can easily refresh the form about 30 times a second while using .NET's built-in double buffering (the double buffering completely stops the flickering). I can refresh the form a lot faster if I disable the double buffering, but then it flickers way too much.