Back to Devexpress

TdxSmartGlyph.SourceDPI Property

vcl-dxgdiplusclasses-dot-tdxsmartglyph.md

latest2.5 KB
Original Source

TdxSmartGlyph.SourceDPI Property

Specifies the target monitor DPI for the stored glyph.

Declaration

delphi
property SourceDPI: Integer read; write;

Property Value

TypeDescription
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:

delphi
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;
cpp
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);
}

Default Value

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

See Also

dxDPIAwareUtils.dxCheckDPIValue Function

IdxSourceDPI.GetSourceDPI Function

TcxBaseImageList.SourceDPI Property

TdxSmartGlyph Class

TdxSmartGlyph Members

dxGDIPlusClasses Unit