HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

SetImageScaling

Select whether all images drawn by the button control are automatically scaled for the current monitor DPI.

C

void SftButton_SetImageScaling(HWND hwndCtl, int mode);

C++

void CSftButton::SetImageScaling(int mode);

Parameters

hwndCtl

The window handle of the button control.

mode

One of:

SFTBUTTON_IMAGESCALING_ASIS (0)Images are drawn at their native pixel size. Bitmaps supplied at 96 DPI look physically smaller on a high-DPI monitor.
SFTBUTTON_IMAGESCALING_STRETCH (1)Default. Images are scaled by currentDPI / 96. Bitmaps use HALFTONE stretch; GDI+ images use InterpolationModeHighQualityBicubic.

Comments

SetImageScaling is the image-side of Per-Monitor DPI awareness. The default is STRETCH: every image the control draws (per-state foreground pictures and background pictures) is scaled automatically for the current monitor DPI. The application ships a single set of 96-DPI images and the control handles resolution-independent rendering.

Applications that ship multiple image sizes (or that want explicit control over the scaled appearance) should set SetImageScaling to ASIS and re-register images at the appropriate size on each SFTBUTTONN_DPI_CHANGED.

See Also GetImageScaling | SetPixelScaling | Per-Monitor DPI and Scaling


Last Updated 04/26/2026 - (email)
© 2026 Softel vdm, Inc.