Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

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

Image/Pixel-Color Operations

DPI. - Get Desktop DPI

Previous Top Next


MiniRobotLanguage (MRL)

 

DPI. Command

Get Desktop Dots per Inch

 

 

Intention

 

DPI. will give you the

    DPI. X and Y values of the desktop

    DPI. X and Y-Ratio

 

Usage is simple. Using DPI. without any parameters will place the dpi-X and the dpi-Y values on Top of Stack.

 

DPI.

' Show TOS

DBP.$$000

ENR.

 

To get the X- and Y- Scaling Ratios, just add an s-prototype.

 

DPI.s

DBP.$tos$

ENR.

 

Now you can add prototypesand variables to get the results into variables instead into the TOS. Examples:

 

DPI.$$XDP,$$YDP

DBP.$$XDP,$$YDP

ENR.

 

and

 

DPI.s|$$XDP,$$YDP

DBP.$$XDP,$$YDP

ENR.

 

If you specify only one variable, you will get both values, separated with a comma into that variable. Examples:

 

DPI.d|$$XDP

DBP.$$XDP

ENR.

 

DPI.s|$$XDP

DBP.$$XDP

ENR.

 

There is a special mode for DPI.:

 

DPI.$$XDP

DBP.$$XDP

ENR.

 

This way you can get just the x-dpi-value into a variable.As both values are often equal, it may be enough for most scripts.

 

 

Hint:

If you just want to check if the Target PC has a specific DPI (dots per Inch) -Setting, prefer the IDP./NDP. command.

 

 

 

Syntax

 

DPI.[P1][|P2][,P3]

 

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 returned, otherwise scaling-ratio values. The sequential order of the prototypes does not play a role in this command. The first variable will always hold the x- and the second variable may only hold the y--results.

 

P2 - (optional) - variable to store the result,

    depending on the prototypes

 

P3 - (optional) - variable to store the result,

    depending on the prototypes

 

 

Speed in Ticks:

This command uses typically around 1900 Ticks.

 

 

Example

 

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

' DPI.-Sample

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

DPI.$$XDP

DBP.$$XDP

ENR.

END.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    1.8. Selecting the Application (Topwindow)

    IDP. / NDP. - If desktop dpi Setting

    IPC. / NPC. - If-Pixel-Colour

    GPC. - Get-Pixel-Colour