HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

Sft_SetPictureColorSample

Store a solid color swatch with optional border in a SFT_PICTURE as a SFT_PICTURE_COLOR_SAMPLE slot.

C

void Sft_SetPictureColorSample(LPSFT_PICTURE lpPicture,
                               int w, int h,
                               COLORREF sampleColor,
                               COLORREF frameColor);

Parameters

lpPicture

Pointer to a SFT_PICTURE. Must not be NULL.

w, h

Width and height of the color swatch in pixels. h must be greater than zero - calling with h <= 0 clears the slot but does not assign a swatch.

sampleColor

The fill color of the swatch.

frameColor

Border color drawn around the swatch. Set to -1 (or SFT_NOCOLOR) to draw no border.

Comments

Sft_SetPictureColorSample calls Sft_ClearPicture internally before assigning the new swatch.

Color samples are useful for color-picker controls, legend entries, and anywhere a small filled rectangle is more meaningful than a bitmap.

See Also SftPicture2 | SFT_PICTURE | SFT_PICTURE_COLOR_SAMPLE | Sft_IsPictureColorSample | SFT_NOCOLOR


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.