Sign in to follow this  
Followers 0
cappy2112

PixelCoordMode

4 posts in this topic

I've setup a few controls in a GUI, but then found out the default PixelCoordMode is 1, which is relative to the full screen.

I thought it would be easier to make the control coordinates relative to the client part of the window, since the gui is very small and will be centered in the screen.

After setting opt("PixelCoordMode", 2), I was surprized to see my controls in exactly the same place as before

I added the opt("PixelCoordMode",2) call.

I don't understant why this is

Share this post


Link to post
Share on other sites



I've setup a few controls in a GUI, but then found out the default PixelCoordMode is 1, which is relative to the full screen.

I thought it would be easier to make the control coordinates relative to the client part of the window, since the gui is very small and will be centered in the screen.

After setting opt("PixelCoordMode", 2), I was surprized to see my controls in exactly the same place as before

I added the opt("PixelCoordMode",2) call.

I don't understant why this is

Why would you think that Opt('PixelCoordMode', 2) << would affect your control position when it deals with 'pixel'coord'' locations?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Why would you think that Opt('PixelCoordMode', 2) << would affect your control position when it deals with 'pixel'coord'' locations?

From the help file

Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

It implies to me that the coordinates are relative to a different window- the screen window, vs the application form window.

50 pixels away from the edge of the screen is different than 50 pixels away form the edge of a dialogue or the application window, right ?

I think I found my answer-> GUICoordMode???

I don't know which API's PixelCoordMode is for, but it seemed like it could be used for positioning any GUI component. THat is, until I found this, by accident -> GUICoordMode.

THis seems more appropriate

Edited by cappy2112

Share this post


Link to post
Share on other sites

From the help file

Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

It implies to me that the coordinates are relative to a different window- the screen window, vs the application form window.

50 pixels away from the edge of the screen is different than 50 pixels away form the edge of a dialogue or the application window, right ?

I think I found my answer-> GUICoordMode???

I don't know which API's PixelCoordMode is for, but it seemed like it could be used for positioning any GUI component. THat is, until I found this, by accident -> GUICoordMode.

THis seems more appropriate

Glad you found your answer... but also look at what you typed ... and I'm sure you'll see why the first option wasn't the answer.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0