HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

Sft_SetPictureBitmap

Store an HBITMAP in a SFT_PICTURE as a SFT_PICTURE_BITMAP slot, or read the HBITMAP back out.

C

void    Sft_SetPictureBitmap(LPSFT_PICTURE lpPicture, HBITMAP hBitmap);
HBITMAP Sft_GetPictureBitmap(LPCSFT_PICTURE lpPicture);

Parameters

lpPicture

Pointer to a SFT_PICTURE. Must not be NULL on the setter; NULL is accepted on the getter and returns NULL.

hBitmap

Bitmap handle. NULL leaves the slot empty (the existing picture is cleared).

Return Value (Sft_GetPictureBitmap)

The HBITMAP stored in the slot, or NULL if the slot is empty or holds a non-bitmap picture type.

Comments

Sft_SetPictureBitmap calls Sft_ClearPicture internally before assigning the new bitmap, so the previous picture's resources are released by the application separately if needed.

The top-left pixel of the bitmap is treated as the transparent color when the host control draws it.

Resource ownership: the application owns the HBITMAP and must keep it alive until either Sft_ClearPicture is called or the host control is destroyed. Use DeleteObject to release the bitmap when the application is done with it.

See Also SftPicture2 | SFT_PICTURE | SFT_PICTURE_BITMAP | Sft_IsPictureBitmap


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