ScreenCapture XY coordinates not working as expected?
Moderators: JRL, Dorian (MJT support)
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
ScreenCapture XY coordinates not working as expected?
Has anyone else noticed this? It seems altering the top left coordinates inteferes with the bottom right ones as though they are relative to each other?
Once the top/left are in perfect position and I go on to place the bottom right ones where they should be, any adjustment in the bottom/right seems to move the top/left, and vise versa.
Also there seems to be a lot of white space around the generated jpg or bmp. I tried at different screen resolutions (800x600 and 1024 x 768) and the results were the same. In my images the white space was always to the top and left of the target area.
I even wrote a macro loop which shows me the exact current coordinates of the mouse as I ove it around, in an attempt to get the right coordinates before I started, but these turn out to be completely different to what screencapture gives me when using those coordinates.
Once the top/left are in perfect position and I go on to place the bottom right ones where they should be, any adjustment in the bottom/right seems to move the top/left, and vise versa.
Also there seems to be a lot of white space around the generated jpg or bmp. I tried at different screen resolutions (800x600 and 1024 x 768) and the results were the same. In my images the white space was always to the top and left of the target area.
I even wrote a macro loop which shows me the exact current coordinates of the mouse as I ove it around, in an attempt to get the right coordinates before I started, but these turn out to be completely different to what screencapture gives me when using those coordinates.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
How about providing the macro script code you are using to help explain what you are seeing?
Also you don't need a macro to show coordinates. Use the Macro Scheduler tools. Open the Editor, select Tools, Cursor Monitor. Use these values in your Macro Scheduler script. These are always absolute values for your screen, no relationship to any windows.
Can also get coordinates for a window by using GetWindowPos. Or if the window is the active one, the Width and Height are already there if you use GetActiveWindow> command. You can then add Width and Height variables to get lower right values for ScreenCapture.
Also you don't need a macro to show coordinates. Use the Macro Scheduler tools. Open the Editor, select Tools, Cursor Monitor. Use these values in your Macro Scheduler script. These are always absolute values for your screen, no relationship to any windows.
Can also get coordinates for a window by using GetWindowPos. Or if the window is the active one, the Width and Height are already there if you use GetActiveWindow> command. You can then add Width and Height variables to get lower right values for ScreenCapture.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Maybe I've missunderstood the topic at all:
I'm creating screenshoots with the press of ALT+Print (active window) to paste them afterwards into MSPaint. (My) MSPaint default image size is set to 1x1 pixel. If the screenshot won't fit to that default
MSPaint requests if the image should be enlarged to fit tight.
I'm using Capture a tool from AnalogX
Marcus, would it make sense to get two optional params for MSched's ScreenCapture command, F(ull screen) and A(ctive window) as a Print, ALT+Print replacement ?
I'm creating screenshoots with the press of ALT+Print (active window) to paste them afterwards into MSPaint. (My) MSPaint default image size is set to 1x1 pixel. If the screenshot won't fit to that default

I'm using Capture a tool from AnalogX
Marcus, would it make sense to get two optional params for MSched's ScreenCapture command, F(ull screen) and A(ctive window) as a Print, ALT+Print replacement ?
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Hi Guys,
Many thanks for the input. OK, here's what I am trying to do :
I have a program which makes astrological chartwheels, which I give away to me web visitors as a freebie. The program does not output these to a file, so a screendump is required. Then I *used to* open the dump in ulead photoimpact, and the macro would crop and save it. Now with the latest version of MS I can capture and crop all in one go, theoretically, without the need for photoimpact....
>>> the following just sets focus on the astro program, then does what is required to retrieve birth data from the file and create the wheel...
let>dir=1
label>start1
CapsOff
SetFocus>PCA
wait>0.05
Press Down
wait>0.05
Press CTRL
Send Character/Text>f
Release CTRL
Wait>0.05
setfocus>Birth*
wait>0.05
sen>0
wait>0.05
Press CTRL
Send Character/Text>c
Release CTRL
wait>0.05
getclipboard>nm
wait>0.05
if>%nm%=#############,end
SetFocus>PCA
wait>0.1
sen>r
wait>0.1
sen>v
>>>at this point the wheel has been drawn and is on the screen. below is the beginning of the capture and crop routine...
wait>0.2
>>> captures the image using a fixed name to get around the limitation of this commannd not liking spaces in the filename, checks to see if the real name already exists, and if it does saves it using the real name to the next directory.
ScreenCapture>150,61,800,606,d:\wheels01\123qaz.jpg
label>x
IfFileExists>d:\wheels0%dir%\%nm%.jpg,nextdir
movefile>d:\wheels01\123qaz.jpg,d:\wheels0%dir%\%nm%.jpg
wait>0.1
press del
goto>start1
label>nextdir
let>dir=dir+1
goto>x
label>end
It's hard to describe the way it's being odd, so I put this example up here :
http://www.2hosts.com/macro.htm
Many thanks for the input. OK, here's what I am trying to do :
I have a program which makes astrological chartwheels, which I give away to me web visitors as a freebie. The program does not output these to a file, so a screendump is required. Then I *used to* open the dump in ulead photoimpact, and the macro would crop and save it. Now with the latest version of MS I can capture and crop all in one go, theoretically, without the need for photoimpact....
>>> the following just sets focus on the astro program, then does what is required to retrieve birth data from the file and create the wheel...
let>dir=1
label>start1
CapsOff
SetFocus>PCA
wait>0.05
Press Down
wait>0.05
Press CTRL
Send Character/Text>f
Release CTRL
Wait>0.05
setfocus>Birth*
wait>0.05
sen>0
wait>0.05
Press CTRL
Send Character/Text>c
Release CTRL
wait>0.05
getclipboard>nm
wait>0.05
if>%nm%=#############,end
SetFocus>PCA
wait>0.1
sen>r
wait>0.1
sen>v
>>>at this point the wheel has been drawn and is on the screen. below is the beginning of the capture and crop routine...
wait>0.2
>>> captures the image using a fixed name to get around the limitation of this commannd not liking spaces in the filename, checks to see if the real name already exists, and if it does saves it using the real name to the next directory.
ScreenCapture>150,61,800,606,d:\wheels01\123qaz.jpg
label>x
IfFileExists>d:\wheels0%dir%\%nm%.jpg,nextdir
movefile>d:\wheels01\123qaz.jpg,d:\wheels0%dir%\%nm%.jpg
wait>0.1
press del
goto>start1
label>nextdir
let>dir=dir+1
goto>x
label>end
It's hard to describe the way it's being odd, so I put this example up here :
http://www.2hosts.com/macro.htm
Once you've saved that screenshot with MSched's ScreenCapture> command you could follow this tutorial using ImageMagick to work on your : Graphics from the command line
Where to get ImageMagick
--> [here]
Where to get ImageMagick

- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Have you tried using %X1%,%Y1%,%X2%,%Y2% to replace the 150,61,800,606 values?
NEVER MIND! I've got it! This does appear to be a bug. Explanation follows:
I made a few screen captures and noticed that the white areas to the left and top are the same dimensions as the X,Y coordinates.
Example, if I do ScreenCapture>26,70,655,570,c:\temp\26_70.jpg then I get a white area that is 26 pixels wide to the left (X) and 70 pixels tall at the top (Y). ScreenCapture>126,170,655,570,c:\temp\126_170.jpg gives me an image with wider left side (126) and taller at top (170)
The "canvas" that is presented is the correct dimensions defined by ScreenCapture, and the image that is clipped is actually clipped at the correct X,Y start point, but the image is laid on the canvas at the X,Y coordinates of the canvas, not at the 0,0 coordinates.
Cannot think of a work around.
Hmm.....just looked at the link you provided. That was helpful. Since the coordinates will be absolute, I think before you use the Tool to capture the coordinates you should maximize the PCA ARGUS window. The Radix window looks maximized, but not the parent.//Use GAW for child window, else let GAW_TYPE= default of 0.
Let>GAW_TYPE =1
GetActiveWindow>WindowName*,X1,Y1,Width,Height
Let>X2=%X1%+%Width%
Let>Y2=%Y1%+%Height%
ScreenCapture>%X1%,%Y1%,%X2%,%Y2%,d:\wheels01\123qaz.jpg
NEVER MIND! I've got it! This does appear to be a bug. Explanation follows:
I made a few screen captures and noticed that the white areas to the left and top are the same dimensions as the X,Y coordinates.
Example, if I do ScreenCapture>26,70,655,570,c:\temp\26_70.jpg then I get a white area that is 26 pixels wide to the left (X) and 70 pixels tall at the top (Y). ScreenCapture>126,170,655,570,c:\temp\126_170.jpg gives me an image with wider left side (126) and taller at top (170)
The "canvas" that is presented is the correct dimensions defined by ScreenCapture, and the image that is clipped is actually clipped at the correct X,Y start point, but the image is laid on the canvas at the X,Y coordinates of the canvas, not at the 0,0 coordinates.
Cannot think of a work around.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
Thanks Bob,
It's good to know I wasn't doing something wrong. I was tearing my hair out trying to resolve this one. Hopefully Marcus will cure the bug in the next update.
In the meantime I will investigate ImageMagick - thanks Lumumba.
Incidentally, I've been using MS for years, and never even noticed there was a tools menu!
So thanks ever-so for pointing that out!
It's good to know I wasn't doing something wrong. I was tearing my hair out trying to resolve this one. Hopefully Marcus will cure the bug in the next update.
In the meantime I will investigate ImageMagick - thanks Lumumba.

Incidentally, I've been using MS for years, and never even noticed there was a tools menu!

Another screen capture program that takes command lines and works well with macro scheduler is version 4 of hypersnap from http://www.hyperionics.com
- Dorian (MJT support)
- Automation Wizard
- Posts: 1415
- Joined: Sun Nov 03, 2002 3:19 am
That's very interesting, thank you. I've been looking for something like hypercam too, so I know that publisher will be very useful to me.Anonymous wrote:Another screen capture program that takes command lines and works well with macro scheduler is version 4 of hypersnap from http://www.hyperionics.com
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Also see reply made today on related subject at:
http://www.mjtnet.com/forum/viewtopic.php?p=4081#4081
http://www.mjtnet.com/forum/viewtopic.php?p=4081#4081
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Hi,
Well isn't that's nice. It's comments like this that make it all worth while!
Be warned. That kind of language and attitude will get you kicked off this forum.
As far as the bug is concerned I am sorry that it was overlooked. This is why we have introduced the BugTracker (http://www.mjtnet.com/bugtracker/) so that we don't miss bug reports in future. I have now added this bug to BugTracker and confirmed it.
Well isn't that's nice. It's comments like this that make it all worth while!
Be warned. That kind of language and attitude will get you kicked off this forum.
As far as the bug is concerned I am sorry that it was overlooked. This is why we have introduced the BugTracker (http://www.mjtnet.com/bugtracker/) so that we don't miss bug reports in future. I have now added this bug to BugTracker and confirmed it.
MJT Net Support
[email protected]
[email protected]