HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

Sft_ClearPicture

Reset a SFT_PICTURE to the empty state. Asserts that the structure is not internally owned (does not have SFT_PICFLAG_FREE set) and that the type value is one of the recognized SFT_PICTURE_* constants.

C

void Sft_ClearPicture(LPSFT_PICTURE lpPicture);

Parameters

lpPicture

Pointer to a SFT_PICTURE. Must not be NULL.

Comments

Call before deallocating a SFT_PICTURE or before assigning a different picture into the same slot. The Sft_SetPicture* setters call Sft_ClearPicture internally, so direct calls are needed only when the application wants to leave the slot empty.

Resource ownership: Sft_ClearPicture only zeroes the structure - it never destroys handles or releases COM references stored in the Picture union. Resources stored in a SFT_PICTURE remain owned by the application; clear the structure first, then release the resource through the appropriate Win32 / COM call (DeleteObject, DestroyIcon, IPicture::Release, delete (Gdiplus::Image*), etc.).

The internal assertion on type catches uninitialized SFT_PICTURE memory - if Sft_ClearPicture asserts, the structure was likely never zeroed (use Sft_InitPicture on freshly allocated SFT_PICTURE instances).

See Also SftPicture2 | SFT_PICTURE | Sft_InitPicture | Sft_CopyPicture


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