Capturing an image of a webpage ? |
Post Reply |
Author | |
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
Posted: 02 October 2008 at 2:30am |
Hello,
Did someone know how to create an image of a webpage from a webbrowser (Ms or Cj) ?
I try to create a thumbnail of a webpage shown in a WB but no way for the moment...
Any idea ?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
google + "Screenshot of Web Page in VB" will help. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Already done that dear Oleg.
But all i've found is for asp.net ou .net in general, not for VB6...
|
|
Mr.Den
Groupie Joined: 26 August 2007 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
To do a screenshot in VB6, I use a Pegasus activex control for the picture container, but you should be able to change the code to use a picturebox:
Put this code in the declarations of a form
'print screen Put this code in a sub:
'call the Windows keybd_event sub, passing the built-in
'VB keyboard constant vbKeySnapshot (44) to the sub. 'The four parameters for keybd_event are: 'BYTE bVk 'virtual-key code 'BYTE bScan 'hardware scan code 'DWORD dwFlags 'flags specifying various function options 'DWORD dwExtraInfo 'additional data associated with keystroke 'The second parameter (bScan) determines what 'to copy... passing 0& copies the screen or 'passing 1& copies the active form. keybd_event vbKeySnapshot, 0&, 0&, 0& 'pause to let Windows update the clipboard DoEvents 'retrieve the clipboard bitmap to the control obPix.Picture = Clipboard.GetData(vbCFBitmap) obPix.SaveFileType = 8 obPix.SaveJPGChromFactor = 12 obPix.SaveJPGLumFactor = 15 obPix.SaveJPGSubSampling = SS_111 obPix.SaveFileName = "C:\Test.jpg" obPix.SaveFile |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, try convert this project from C# to VB - http://www.codeproject.com/KB/graphics/IECapture.aspx
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Lodep59
Senior Member Joined: 03 April 2008 Status: Offline Points: 203 |
Post Options
Thanks(0)
|
Mr Den : Thank you, but if the webpage is very long the screenshot will not take all the web page.
Oleg : I'll try but don't think it's possible, C# to VB6 is a very hard conversion :( Perhaps you can add this functionnality to your web browser control ?
Thank you for all !
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |