HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

Sft_SetPictureGDIPlusImage

Store a Gdiplus::Image* pointer in a SFT_PICTURE as a SFT_PICTURE_GDIPLUS slot. GDI+ images cover PNG, TIFF, JPEG, GIF, EMF+ and any other format the Windows GDI+ runtime supports.

C

void Sft_SetPictureGDIPlusImage(LPSFT_PICTURE lpPicture, LPVOID lpImageObject);

Parameters

lpPicture

Pointer to a SFT_PICTURE. Must not be NULL.

lpImageObject

A Gdiplus::Image* pointer cast to LPVOID. NULL leaves the slot empty. The cast is required because the SftPicture2 header avoids a hard dependency on gdiplus.h.

Comments

Sft_SetPictureGDIPlusImage calls Sft_ClearPicture internally before assigning the new pointer.

Resource ownership: the application creates and owns the GDI+ Image object - typically through new Gdiplus::Image(...) or one of the per-product loader helpers (e.g. SftButton_LoadGDIPlusImageFromFile). Release the image with delete (or the matching loader-pair free) only after the host control no longer references it.

GDI+ must be initialized in the process before the image is created. The per-product loader helpers handle initialization automatically; applications that construct the Gdiplus::Image directly need to call Gdiplus::GdiplusStartup themselves.

See Also SftPicture2 | SFT_PICTURE | SFT_PICTURE_GDIPLUS | Sft_IsPictureGDIPlusImage


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