-
Screenshot and Stuff
Hi!
Got a little problem.
Screenshots. While taking them and importing them inte VB takes about a second. Is there any faster way?
Then I want to get the area that changed from the new screenshot and the old screenshot (just that square) and save it into memory for transfer.
This method would take some time and because I'm working on a small remote control app, I want it to go faster thatn 1-2 seconds between each frame. Then it would be kinda slow.
Is it possible to do this, and if so how?
-
Can I ask how you are taking the screenshots, I can't remember it taking so long.
-
Code:
[Pseudo]
DC = GetWindowDC(GetDesktopWindow)
BitBlt YourPicture, 0, 0, DC, 0, 0, ScreenW, ScreenH, vbSrcCopy
[/Pseudo]
-
yeah that never took me long.
-
I have a Similar Problem
1) If you are using the Clipboard to get the ScreenShot its much Slower that going internally and using the Desktop Dc (if you dont know what i am talking about write to me at [email protected] ill explain)
2)I also want to know how to grab a selected Rectangle and paste it as background into a form to make a fake transparency. The problem Lies in Unit conversion (if you can ,see my post).
3)I can Help you giving you some advice
you can get the current window handle with the GetForgroundWindow Api and from there get its Dc that way you wont have to retransfer the Whole Desktop only the window...
Any Progress Tell me... im also very interested in doing a remote capture app myself..
-
Well, I pressed the Print Screen button, and got the Data from the ClipBoard, but it took eternity, so I've found a faster way.
'// Used to get the Window DC
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
'// Used to get the desktops hWnd
Private Declare Function GetDesktopWindow Lib "user32" () As Long
'// Need 2 explain BitBlt?
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, _
ByVal ySrc As Long, ByVal dwRop As Long) As Long
BitBlt DestImg.hDC, 0, 0, 500, 500, GetDC(GetDesktopWindow()), 0, 0, vbSrcCopy