Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Programming Languages (http://www.programmingforums.org/forum38.html)
-   -   Command line screen capture (http://www.programmingforums.org/showthread.php?t=14693)

davil Dec 5th, 2007 5:29 AM

Command line screen capture
 
Anyone know of any useful apps to capture screen to compressed JPG (compression can be set)

I have tried this code in Autoit:
:

  1. ; Capture full screen
  2. ; Fist parameter - filename, last - jpeg quality.
  3. DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85)
  4. ; Capture given region
  5. ; Fist parameter - filename, next four: left, top, width, height. Last one - jpeg quality.
  6. ; Set quality to any negative number to capture into BMP
  7. DllCall("captdll.dll", "int", "CaptureRegion", "str", "dump_partial.bmp", "int", 100, "int", 100, "int", 300, "int", 200, "int", -1)


and it does save the JPG but gives up an error like this:
AutoIT has detected the stack has become corrupt.
Obviously some sort of problem with the DLL

but if there's code for this in C or C++ or BASIC or anything that anyone has, I'll take it.... This application would be extremely useful for our I.T. Department.

Any help is much appreciated. Thanks for reading

Salem Dec 6th, 2007 10:02 AM

Re: Command line screen capture
 
Stack corruption can be caused by getting the calling convention wrong.
http://www.hiddensoft.com/autoit3/do...ns/DllCall.htm

Perhaps
DllCall("captdll.dll", "int:cdecl", "CaptureScreen" ....

davil Dec 6th, 2007 10:04 AM

Re: Command line screen capture
 
Thanks. that works perfectly now.


All times are GMT -5. The time now is 5:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC