Jump to content

PixelCoordMode


cappy2112
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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?

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...