Results 1 to 2 of 2

Thread: Screenshot of control

  1. #1

    Thread Starter
    Member Twango's Avatar
    Join Date
    Mar 2010
    Posts
    63

    Screenshot of control

    Hi, i need to make a screen capture... but just of a web browser control...
    i got everything but how to get JUST the web control..
    thanks

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Screenshot of control

    try this:

    vb Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.     Dim img As New Bitmap(WebBrowser1.ClientSize.Width + 2, WebBrowser1.ClientSize.Height + 2)
    3.     Dim gr As Graphics = Graphics.FromImage(img)
    4.     Dim p As Point = WebBrowser1.PointToScreen(New Point(0, 0))
    5.     p.Offset(-1, -1)
    6.     gr.CopyFromScreen(p, New Point(0, 0), WebBrowser1.Size)
    7.     img.Save("filename", Drawing.Imaging.ImageFormat.Jpeg)
    8.     Process.Start("filename")
    9. End Sub

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