Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > General Discussion
  New Posts New Posts RSS Feed - Capturing an image of a webpage ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Capturing an image of a webpage ?

 Post Reply Post Reply
Author
Message
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Topic: Capturing an image of a webpage ?
    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 ?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2008 at 4:11am

google + "Screenshot of Web Page in VB" will help.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2008 at 4:27am
Originally posted by oleg oleg wrote:

google + "Screenshot of Web Page in VB" will help.

 
Already done that dear Oleg.
But all i've found is for asp.net ou .net in general, not for VB6...
Back to Top
Mr.Den View Drop Down
Groupie
Groupie
Avatar

Joined: 26 August 2007
Status: Offline
Points: 50
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mr.Den Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2008 at 11:53am
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
        Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
        ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2008 at 1:57am

Hi,

try convert this project from C# to VB - http://www.codeproject.com/KB/graphics/IECapture.aspx
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Lodep59 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 03 April 2008
Status: Offline
Points: 203
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lodep59 Quote  Post ReplyReply Direct Link To This Post Posted: 03 October 2008 at 3:23am
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 !
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.