Results 1 to 3 of 3

Thread: Getimage of control function problem....plz help...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    305

    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....???

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    305

    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.....

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Posts
    305

    Angry Re: Getimage of control function problem....plz help...

    hey guys, any idea?? am i not clear enough??

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