Why does this not work?

hog

Well-known member
Joined
Mar 17, 2003
Messages
984
Location
UK
Im trying to use this code to draw a simple ball over a picture box image. The image in the picture box is a .jpg and the image in the bitmap is a .gif, although I have tried with .bmp and .jpg with no joy:(

Code:
Public Sub Draw(ByVal WinHandle as System.IntPtr)

        Dim grxBackground As Graphics

        grxBackground = Graphics.FromHwnd(WinHandle)

        grxBackground.DrawImageUnscaled(bmpSource, Location.X, Location.Y)

        grxBackground.Dispose()

End Sub
 
This code works OK. It was the call that was the problem, not a good idea to put it in the forms load event
 
Back
Top