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

TdxSmartGlyph.SourceDPI Property

Specifies the target monitor DPI for the stored glyph.

#Declaration

Delphi
property SourceDPI: Integer read; write;

#Property Value

Type Description
Integer

The image container’s target monitor DPI.

The property value must be within the range between dxMinDPI and dxMaxDPI global constant values.

#Remarks

You can use the SourceDPI property to specify the base DPI value for the Smart Glyph container. The container multiplies the stored image’s width and height by the ratio between the monitor DPI and the SourceDPI property to calculate the image’s on-screen pixel dimensions.

#Code Example: Disable Built-in Glyph Scaling

The following code example overrides the TdxForm.ScaleFactorChanged procedure to disable the built-in scaling mechanism for UI element glyphs:

type
  TMyForm = class(TdxForm)
    FSmartGlyphContainer: TdxSmartGlyph;
//...
    procedure ScaleFactorChanged(M, D: Integer); override;
//...
  end;
//...
procedure TMyForm.ScaleFactorChanged(M, D: Integer);
begin
  FSmartGlyphContainer.SourceDPI := Self.ScaleFactor.Apply(dxDefaultDPI);
end;

#Default Value

The SourceDPI property’s default value is the dxDefaultDPI global constant.

See Also