Skip to main content

TdxSmartGlyph.SourceDPI Property

Specifies the monitor DPI value for which the glyph image is created.

Declaration

property SourceDPI: Integer read; write;

Property Value

Type
Integer

Remarks

Use this property to set the “base” DPI value for an image stored within the Smart Glyph container. The container uses the SourceDPI property value to calculate the glyph’s dimensions (in pixels) on a screen depending on its DPI. The image on-screen width and height are calculated as the source glyph width and height values multiplied by the ratio between the monitor DPI and the SourceDPI property value.

If you need to avoid the automatic on-screen glyph dimension scaling in a DPI-aware application, update the SourceDPI property with a new DPI value of the screen on which the DPI-aware form with the Smart Glyph container is displayed. To achieve that end, override the ScaleFactorChanged procedure in your application form class:

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);  // Updates the Smart Glyph container's source DPI with the form's new DPI value to negate scaling
end;

Note

The dxMinDPI and dxMaxDPI global constants determine the minimum and maximum SourceDPI property values, respectively.

The default SourceDPI property value is the dxDefaultDPI global constant.

See Also