I've a question about High-DPI application in Delphi. Surfing on the Internet I've found a series of articles published by Žarko Gajić. these articles speaks about create Delphi application ready for High-DPI. The method describes works fine but, the author use it inside every single application; for example speaking about TSpeedButtons.
My question is this: there is a way to implement this kind of behaviour also into components? For example I'm realising a simple component that works like the Embarcadero TSpeedButton but using Transparent PNG images. The images inside the component are loaded at design-time from some PNG images. I've a TObjectDictionary in which I register the buttons states: enabled, disabled and so on.It is declared in this way:
FGlyphs: TObjectDictionary<TGlyphState, TPicture>
In the application that use this component I load PNG images from the files that are 24 x 24 pixel. When I execute the application on a 4K monitor this images become very small. If I apply the Žarko method all works well but in this way every application the use my component need to implement this solution.
How to implement it directly inside the component? I thought to implement it inside the SetGlyph procedure, that is like the following code, but I don't know if this is the right place.
procedure TNCRSpeedButton.SetGlyphs(Index: TGlyphState; Value: TPicture);
begin
FGlyphs.Items[Index].Assign(Value);
end;
TGlyphState is defined in this way:
TGlyphState = (gtEnabled, gtDisabled, gtDown, gtOver);
Eros