vcl-dxgdiplusclasses-dot-tdxsmartglyph.md
Specifies the target monitor DPI for the stored glyph.
property SourceDPI: Integer read; write;
| 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.
|
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.
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;
class TMyForm : public TdxForm
{
TdxSmartGlyph *FSmartGlyphContainer;
//...
void __fastcall ScaleFactorChanged(int M, int D);
//...
}
//...
void __fastcall TMyForm::ScaleFactorChanged(int M, int D)
{
FSmartGlyphContainer->SourceDPI = this->ScaleFactor->Apply(dxDefaultDPI);
}
The SourceDPI property’s default value is the dxDefaultDPI global constant.
See Also
dxDPIAwareUtils.dxCheckDPIValue Function
IdxSourceDPI.GetSourceDPI Function