Getimage of control function problem....plz help...
hi guys, ive two custom controls, which are used to draw and edit etc...(like paint but customized....) i want to save their images with a single click....
So im using the Getimageofcontrol function to do it....
its code is below:::
Code:
Public Function GetImageOfControl(ByVal c As Control) As Image
Dim rc As New Rectangle(c.PointToScreen(c.Location), c.Size)
Dim i As Image = New Bitmap(rc.Width, rc.Height)
Dim g As Graphics = Graphics.FromImage(i)
g.CopyFromScreen(rc.Left, rc.Top, 0, 0, rc.Size)
g.Dispose()
Return i
i.Dispose()
End Function
and the code to call this function for saving the images is simply.. ...
Code:
GetImageOfControl(pboxd).Save("c:\78.jpg")
GetImageOfControl2(pboxf).Save("c:\lp.jpg")
but the problem is that both the images have the same content....
how to resolve this problem....???
Re: Getimage of control function problem....plz help...
hi guys, the same thing happens when i try the capturewindowtofile() funciton from screen capture class in the code bank tooo... i think i need to clear some memory etc. but im nt able to figure out what to do, please help.....
Re: Getimage of control function problem....plz help...
hey guys, any idea?? am i not clear enough??:(:o