Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Image/Pixel-Color Operations > Additional Commands >

Image/Pixel-Color Operations

IDP. / NDP.  - If Desktop DPI

Previous Top Next


MiniRobotLanguage (MRL)

 

IDP. Conditional Statement

If Desktop Dots per Inch

 

 

Intention

 

Conditional Statement. Test if the desktop  dpi-Settings are equal to your specified values. You can test the

 

    DPI. X and Y values of the desktop

    DPI. X and Y-scaling Ratio of the desktop

 

against values that you specify. The condition will evaluate TRUE if the Desktop DPI- values match those values that you have specified.

 

Usage is simple. Using IDP. without any parameters will test the dpi-X and the dpi-Y values against the default value of 96 dpi (WinXP). Example:

 

IDP.

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

The next step would be to specify the dpi values we want to compare with. If you specify just one value, then both the X- and the Y-desktop dpi will be compared to that value.

If any of these does not match the 96 dpi, the script will decide FALSE and continue with ELS./EIF.

 

IDP.96

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

Then you can specify both values, the x- and the y-dpi-value. And test for both. Like this:

 

IDP.96,96

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

Now you can ass additional functionality to your script by adding prototypes. This will only compare the x-dpi settings against the specifies value.

 

IDP.x|96

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

Also you can add an y-prototype and test both values.

 

IDP.xy|96,96

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

Then you can specify the "s"-prototype to make the script test the ratio of the scaling instead of the dpi-values.

 

IDP.s|1

 DBV.Yes we have a ratio of 1

ELS.

 DBV.No we haven't a ratio of 1

EIF.

 

adding the prototype "e" will make the robot compare both the x- and the y- values and only evaluate to TRUE, if both are equal. This way we know that both ratios are 1:

 

IDP.es|1

 DBV.Yes we have a ratio of 1

ELS.

 DBV.No we haven't a ratio of 1

EIF.

ENR.

 

The same is possible with dpi-values also:

 

IDP.e|96

 DBP.Yes we have 96 dpi

ELS.

 DBP.No we haven't 96 dpi

EIF.

ENR.

 

Hint:

If you want to get the X-and the Y-value of the Target PC for calculations, prefer the DPI. command.

 

 

 

Syntax

 

IDP.P1[|P2][,P3] … ELS. … EIF.

 

 

Parameter Explanation

 

P1 - (optional) prototype

 

Prototype can be omitted or any of:

 

d - get Screen dpi (default, can be omitted)

s - get screen dpi-ratios (scaling)

x - get x-dpi value

y - get y-dpi value

 

If the s-prototype is omitted, dpi-values are used, otherwise scaling-ratio values. The sequential order of the prototypes does not play a role in this command. The first variable will always be compared against the x- and the second variable may be compared against the the y--values.

 

The usage of P2 and P3 depends on the prototypes

 

P2 - (optional) - variable holding the value to compare the actual

     dpi-settings of the desktop with.

 

 

P3 - (optional) - variable holding the value to compare the actual

     dpi-settings of the desktop with.

 

 

 

 

Example

 

'***********************************

' DPI.-Sample

'***********************************

DPI.$$XDP

DBP.$$XDP

ENR.

END.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    1.6.1. Program Flow Control

    DPI. - Get Desktop DPI-Settings

    IPC. / NPC. - If-Pixel-Colour

    GPC. - Get-Pixel-Colour