HeaderPane
Main
Hide

SftTabs/DLL 7.0 Documentation

Share Link
Print

ImageScaling

Defines how images drawn by the tab control are scaled relative to the current monitor DPI.

C

void WINAPI SftTabs_SetImageScaling(HWND hwndCtl, int mode);
int WINAPI SftTabs_GetImageScaling(HWND hwndCtl);

C++

void CSftTabs::SetImageScaling(int mode);
int CSftTabs::GetImageScaling() const;

Parameters

hwndCtl

The window handle of the tab control.

mode

Defines the image scaling mode. mode can be one of the following values:

SFTTABS_IMAGESCALING_ASISEvery image is drawn at its native pixel size, regardless of the current monitor DPI. This is the default and preserves the traditional SftTabs/DLL behavior. On high-DPI monitors, images supplied at 96 DPI appear physically smaller than the surrounding text.
SFTTABS_IMAGESCALING_STRETCHEvery image is scaled by the factor currentDPI / 96 when drawn. On a 150% DPI monitor, a 16-pixel-tall image is drawn 24 pixels tall; on a 200% monitor it is drawn 32 pixels tall. Bitmap images use StretchBlt with HALFTONE mode; GDI+ images use InterpolationModeHighQualityBicubic.

Returns

GetImageScaling returns a value indicating the current image scaling mode (SFTTABS_IMAGESCALING_ASIS or SFTTABS_IMAGESCALING_STRETCH).

Comments

The SetImageScaling and GetImageScaling functions define how images drawn by the tab control are scaled relative to the current monitor DPI. The setting applies to every image the control draws:

SetImageScaling is independent of SetPixelScaling. SetImageScaling controls the size at which images are drawn; SetPixelScaling controls how caller-supplied pixel dimensions (margins, indentation, forced tab size, etc.) are interpreted. Either can be used without the other.

SFTTABS_IMAGESCALING_ASIS (the default) preserves back-compatible behavior - applications that already supply DPI-appropriate images (or that only target 96 DPI) do not need to change anything.

SFTTABS_IMAGESCALING_STRETCH is the simplest way to make an existing application look correct on high-DPI monitors without shipping multiple image sizes, at the cost of some visual softness from the stretch filter. For best image quality at high DPI, supply higher-resolution master images and leave the mode at SFTTABS_IMAGESCALING_ASIS.

When the control is hosted on a Per-Monitor v2 DPI-aware window, the control re-renders automatically on DPI change. Callers who have opted into SFTTABS_IMAGESCALING_STRETCH do not need to re-register images in response to SFTTABSN_DPI_CHANGED.

See Also C/C++ API | C++ Classes | Notifications


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