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:::
and the code to call this function for saving the images is simply.. ...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
but the problem is that both the images have the same content....Code:GetImageOfControl(pboxd).Save("c:\78.jpg") GetImageOfControl2(pboxf).Save("c:\lp.jpg")
how to resolve this problem....???




Reply With Quote