|
-
Jul 20th, 2010, 11:38 PM
#1
Thread Starter
Hyperactive Member
Screen Picture of webrowser.
I was just wondering if it's even possible to take a screen capture of the webbrowser an save that picture as a jpeg.
Thank you
-
Jul 21st, 2010, 12:48 AM
#2
Re: Screen Picture of webrowser.
have a look at the screen capture link in my signature
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 21st, 2010, 12:54 AM
#3
Thread Starter
Hyperactive Member
Re: Screen Picture of webrowser.
 Originally Posted by .paul.
have a look at the screen capture link in my signature
I cannot get it to work on vb.net 2010
-
Jul 21st, 2010, 12:59 AM
#4
Re: Screen Picture of webrowser.
did you try this one?
http://www.vbforums.com/showpost.php...7&postcount=14
if it still doesn't work, tell me the error + i'll help you get it working
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 21st, 2010, 12:04 PM
#5
Thread Starter
Hyperactive Member
Re: Screen Picture of webrowser.
 Originally Posted by .paul.
It works fine. but what button I press to take the picture? Its so confusing
-
Jul 21st, 2010, 01:20 PM
#6
Re: Screen Picture of webrowser.
just press your prtscr button. (read the full thread)
for choices about what to capture, doubleclick the icon in the system tray.
if you just want to incorporate a screen capture into your app, the capturing is done in the clsScreenCapture.vb class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 21st, 2010, 03:26 PM
#7
Thread Starter
Hyperactive Member
Re: Screen Picture of webrowser.
 Originally Posted by .paul.
just press your prtscr button. (read the full thread)
for choices about what to capture, doubleclick the icon in the system tray.
if you just want to incorporate a screen capture into your app, the capturing is done in the clsScreenCapture.vb class
Ok im using this
vb.net Code:
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim image As Bitmap
Dim fileName As String = ""
fileName = My.Application.Info.DirectoryPath & "\images\" & Replace(Now.ToString.Replace("/", "-"), ":", ".") & ".png"
image = CaptureWindow(User32.GetForegroundWindow, Nothing)
image.Save(fileName, Imaging.ImageFormat.Png)
End Sub
Public Function CaptureWindow(ByVal handle As IntPtr, ByVal r As Rectangle) As Image
' get the size
Dim windowRect As New User32.RECT
Dim width As Integer
Dim height As Integer
If r = Nothing Then
User32.GetWindowRect(handle, windowRect)
'windowRect.left = SplitContainer2.Panel1.Left
'windowRect.top = SplitContainer2.Panel1.Left
width = windowRect.right - windowRect.left
height = windowRect.bottom - windowRect.top
End If
Dim img As Bitmap = New Bitmap(width, height)
Dim gr As Graphics = Graphics.FromImage(img)
gr.CopyFromScreen(windowRect.left, windowRect.top, 0, 0, New Size(width, height))
Return img
End Function
Public Class User32
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure 'RECT
Declare Function GetDesktopWindow Lib "user32.dll" () As IntPtr
Declare Function GetWindowRect Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByRef lpRect As RECT) As Int32
Declare Function GetForegroundWindow Lib "user32.dll" _
Alias "GetForegroundWindow" () As IntPtr
End Class 'User32
End Class
but the problem is that it will take a screenshot of the current active window. How can I change that to take a screen shot of the application and not the curent active window?
Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|