HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

Button Images

SftButton supports three independent image layers, each with its own per-state pictures. Every picture field is an SFT_PICTURE structure that can reference a bitmap, icon, image list entry, check-box / radio-button style, or (when GDI+ is available) a PNG / TIFF / JPEG / GIF / EMF image.

Layers and fields

LayerPer-state fieldsDrawn
Background picturesPictureBG, PictureBGHover, PictureBGPressed, PictureBGDisabledOver the background fill, under the foreground layers
Foreground image 1Picture1, Picture1Hover, Picture1Pressed, Picture1DisabledOver the background pictures
Foreground image 2Picture2, Picture2Hover, Picture2Pressed, Picture2DisabledOver foreground image 1

Fallback

Hover, Pressed and Disabled variants are optional. If a per-state field is left empty, the control falls back to the base variant. A button that only defines Picture1 renders the same image in every state.

Transparency

Bitmaps are automatically made transparent by inspecting the top-left pixel - see Bitmap Transparency. Icons, image list entries and GDI+ images preserve their native transparency. Alpha-blended GDI+ images (PNG with transparency, TIFF, EMF+) render correctly over gradients and background pictures.

Image scaling and DPI

By default, images are scaled by currentDPI / 96 so a single set of 96-DPI bitmaps renders at the right physical size on any monitor. Applications that ship pre-scaled images and want them drawn at their native pixel size can call SetImageScaling with SFTBUTTON_IMAGESCALING_ASIS. See Per-Monitor DPI and Scaling.


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