Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IdxSourceDPI.GetSourceDPI Method

Returns the monitor DPI value for which the stored image is designed.

#Declaration

Delphi
function GetSourceDPI: Integer;

#Returns

Type
Integer

#Remarks

All DevExpress controls use the image source DPI value to calculate the on-screen image dimensions (in pixels) in a running application, depending on the current screen DPI. The resulting on-screen image width and height are calculated by multiplying the image’s original width and height values by the ratio between the monitor DPI and the value returned by the GetSourceDPI function.

The dxGetImageSourceDPI function calls the GetSourceDPI function internally for the specified image list or container.

To avoid the automatic on-screen image size scaling, return the source DPI value matching the current monitor DPI in your implementation of the GetSourceDPI function in a TGraphic or TCustomImageList class descendant.

Note

A value returned by the GetSourceDPI function, must be within the range whose lower and upper bounds are determined by the dxMinDPI and dxMaxDPI global constants, respectively. Call the dxCheckDPIValue function to clamp the returned value within the supported DPI interval.

See Also