HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

FreeGDIPlusImage

Free a GDI+ image previously returned by SftButton_LoadGDIPlusImageFromResource or SftButton_LoadGDIPlusImageFromFile.

C

void SftButton_FreeGDIPlusImageLoadedFromResource(LPVOID pGDIPlusImage);
void SftButton_FreeGDIPlusImageLoadedFromFile(LPVOID pGDIPlusImage);

Parameters

pGDIPlusImage

A pointer returned by the matching SftButton_LoadGDIPlusImage* function, or NULL (no-op).

Comments

A pointer obtained from LoadGDIPlusImageFromResource must be released through FreeGDIPlusImageLoadedFromResource; a pointer from LoadGDIPlusImageFromFile must be released through FreeGDIPlusImageLoadedFromFile. Passing a pointer through the wrong free routine leaks the intermediate buffer used during load.

Free the image only after every SftButton control referencing it has been destroyed or has had the corresponding SFT_PICTURE slot cleared (set the slot to a different SFT_PICTURE or to an empty SFT_PICTURE through SetControlInfo). The control reads lpImageObject on every paint and does not check whether the GDI+ object is still valid.

See Also LoadGDIPlusImageFromResource | LoadGDIPlusImageFromFile | SFT_PICTURE | GDI+


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