Connecting Tech Pros Worldwide Help | Site Map

How to get entire form content for capturing form as image

Newbie
 
Join Date: Jun 2007
Posts: 2
#1: Jun 16 '07
I want to capture the full content of a form even if the form is too large. I want entire form content with in one image. that will be saved in the physical drive. Kindly help plz...
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Jun 18 '07

re: How to get entire form content for capturing form as image


Welcome to TSDN. Here is one way:
Expand|Select|Wrap|Line Numbers
  1. ' start internet explorer with parameter(1) as page 
  2. ' grab screen into picture001.jpg file name 
  3.  
  4. Set WshShell = WScript.CreateObject("WScript.Shell") 
  5. Set WshShell2 = WScript.CreateObject("WScript.Shell") 
  6.  
  7. Return = WshShell.Run("cmd /c del c:\upload\picture0?.jpg", 3) 
  8. Return = WshShell.Run("cmd /c del c:\upload\picture.jpg", 3) 
  9.  
  10. Set Args = WScript.Arguments 
  11.  
  12. Return = WshShell.Run("c:\progra~1\intern~1\iexplore.exe -k " & args(0), 3) 
  13.  
  14. WshShell.AppActivate "Internet Explorer" 
  15. WScript.Sleep 14000 
  16.  
  17. 'There are 6 levels of the JPEG compression. 
  18. ' jpgs = JPEG Superb 
  19. ' jpgh = JPEG High 
  20. ' jpgg = JPEG Good 
  21. ' jpgn = JPEG Normal 
  22. ' jpga = JPEG Average 
  23. ' jpgb = JPEG Bad 
  24.  
  25. WshShell2.Run("C:\Progra~1\Howies~1\HQScreen.exe 0 jpgs 24 picture c:\upload\ 1") 
  26. WScript.Sleep 1000 
  27. WshShell.SendKeys "%{F4}" 
  28.  
  29.  
  30. ' load the created picture 
  31. ' and resize 
  32. ' and save as "picture.jpg" 
  33.  
  34. Set ctrl = createobject("GflAx.GflAx") 
  35.  
  36. ctrl.enablelzw = True 
  37. ctrl.LoadBitmap "c:\upload\picture001.jpg" 
  38.  
  39. ctrl.Saveformat = 1 ' AX_JPEG 
  40. ctrl.ChangeColorDepth AX_ToTrueColors 
  41.  
  42. imageheight = ctrl.height 
  43. imagewidth = ctrl.width 
  44.  
  45. newheight = 250 
  46. newWidth = (newHeight * ctrl.Width) / ctrl.Height 
  47. ctrl.Resize newWidth, newHeight 
  48.  
  49. ctrl.savebitmap "c:\upload\picture.jpg" 
  50. set ctrl=nothing 
  51.  
  52. ' delete original picture001.jpg file 
  53.  
  54. Return = WshShell.Run("cmd /c del c:\upload\picture001.jpg", 3) 
Newbie
 
Join Date: Jun 2007
Posts: 2
#3: Jun 19 '07

re: How to get entire form content for capturing form as image


Thank you for your reply. but i want the form as a image in .net windows application. Could u plz help me in this???
Reply


Similar .NET Framework bytes