capture screen
Nov 10, 2008 19:55:56 GMT -5
Post by marcioc on Nov 10, 2008 19:55:56 GMT -5
Any idea in how to capture a screen in RB or Java script?
Marcio
Marcio
' LB side of LB-RB data-passing ing via 'R:/screen.jpg'.
' RB running on the server on the same machine can insert the screengrab
' onto any served-up pages.
' You set up a RamDisk R: and at timed intervals put in it a screengrab as a jpg
' The rest of the time this program sleeps.
' Close the mini-window at top LH screen when you want it to stop updating.
' You also need pct_dll.dll in the system dir or same as this prog is in.
' http://www.vfug.org/files/pct_dll.zip
' Interestingly, kill needs backslash but the dll accepts forward or back.
' (Haven't tried on the Linux server yet.)
nomainwin
WindowWidth = 10
WindowHeight = 2
UpperLeftX = 1
UpperLeftY = 1
open "LB" for graphics as #main
print #main, "trapclose [quit.main]"
hW =hwnd( #main)
calldll #user32, "GetParent", hW as long, hP as long
open "pct_dll.dll" for dll as #conv
[run]
'1 window to bmp
dest$ ="R:\window.bmp"
hP =0' sowill grab whole screen
calldll #conv, "formtobmp", hP as ulong, dest$ as ptr, r as long
source$ ="R:\window.bmp": dest$ ="R:\window.jpg"
calldll #conv, "tojpeg", source$ as ptr, dest$ as ptr, r as long
kill "R:\window.bmp" 'remove the bmp version
calldll #kernel32, "Sleep", 10000 as ulong, r as void
' ie 10000 ms or 10 sec- change as you wish.
scan
goto [run]
[quit.main]
close #main
close #conv
end