Sign in to follow this  
Followers 0
D4rk^S0ul

PixelCheckSum

2 posts in this topic

i am currently trying to use pixelchecksum i was wondering how i get a small block no igger then a cm at X:512 Y:384?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Although AutoIt documentation is clear as crystal,i'll tell you a hint...

A 17" monitor has a diagonal of 17x2.54 = 43.18cm... The aspect ratio is 4:3 , right? So according to Pythagoras :

(43.18)^2 = (4x)^2 + (3x)^2 => 1861.54 = 25x^2 => x^2 = 1861.54/25 => x= 8.63 .

The dimension will be then Horizontal: 4 * 8.63 = 34.5 and Vertical : 3 * 8.63 = 25.8 .

If your resolution is 1024x768 then in Horizontal there are 1024/34.5 pixels/cm and in vertical 768/25.8 pixels/cm . That means ~30pixels/cm for both dimensions.... If you want to have a square cm on your screen with its top left corner on 512,384 then you will have to add this in your script (if it is a 17" monitor @ 1024x768):

PixelChecksum ( 512,384,542,414)

I hope that helped a bit.....

Of course there is an easier way to use AutoIt Window Info and use the coordinates it shows by "drawing" an imaginary rectangle and write down the numbers.... But I just had to show off... ;)

C ya

Edited by hgeras

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