Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 5th, 2007, 5:29 AM   #1
davil
Newbie
 
Join Date: Nov 2007
Posts: 27
Rep Power: 0 davil is on a distinguished road
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:
autoit Syntax (Toggle Plain Text)
  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
davil is offline   Reply With Quote
Old Dec 6th, 2007, 10:02 AM   #2
Salem
Programmer
 
Join Date: Nov 2007
Posts: 33
Rep Power: 0 Salem is on a distinguished road
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" ....
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Salem is offline   Reply With Quote
Old Dec 6th, 2007, 10:04 AM   #3
davil
Newbie
 
Join Date: Nov 2007
Posts: 27
Rep Power: 0 davil is on a distinguished road
Re: Command line screen capture

Thanks. that works perfectly now.
davil is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Capture Program ReggaetonKing Show Off Your Open Source Projects 15 Jul 7th, 2007 1:57 PM
Clear screen with Java Eric the Red Java 9 Feb 22nd, 2006 10:28 PM
Getting size of user's screen elford Java 1 Jan 1st, 2006 4:09 AM
Senior Capstone-Spying Screen Saver Hounder Project Ideas 23 Dec 16th, 2005 7:00 PM
Print Screen? Sane C++ 5 Jul 27th, 2005 1:44 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:06 AM.

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