HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

SftPicture2 - Image and Text Description Header

SftPicture2 is the shared header that describes images, glyphs and text labels used by every Softel vdm DLL control (SftTree, SftTabs, SftBox, SftMask, SftButton). The two structures defined here - SFT_PICTURE and SFT_TEXT - appear as fields on per-product control structures (SFTBUTTON_CONTROL.Picture1, SFTTREE_CELL.Picture, SFTTABS_TAB.Picture, etc.) and supply a uniform model for image and text rendering across all DLL controls.

The header provides:

Header inclusion

Per-product DLL headers (SftTree.h, SftTabs.h, SftBox.h, SftMask.h, SftButton.h) include SftPicture2.h automatically. Application code that uses any one of those product headers therefore has access to SFT_PICTURE, SFT_TEXT and the helper functions without an explicit #include "SftPicture2.h".

Direct inclusion is only needed in source files that work with picture / text descriptors but do not include any per-product header (rare).

Type discrimination

SFT_PICTURE is a type-tagged union: the type field selects which arm of the embedded Picture union is meaningful, and the Sft_SetPicture* setters keep both fields consistent with each other. Reading code can use the Sft_IsPicture* predicates instead of switching on type directly.

Per-product support: not every DLL control supports every SFT_PICTURE_* type. Each product's documentation lists the picture types it accepts.

Picture types

ConstantSlotDescription
SFT_PICTURE_BITMAPPicture.hBitmapA device-dependent bitmap. Top-left pixel is the transparent color.
SFT_PICTURE_ICONPicture.hIconAn icon of any size.
SFT_PICTURE_ICON_16x16Picture.hIconDiscontinued. 16x16 icon. New code should use SFT_PICTURE_ICON.
SFT_PICTURE_ICON_32x32Picture.hIconDiscontinued. 32x32 icon (alias for SFT_PICTURE_ICON). New code should use SFT_PICTURE_ICON.
SFT_PICTURE_IMAGELISTPicture.ImageAn entry in an image list. Holds the HIMAGELIST plus normal and disabled image indices.
SFT_PICTURE_IMAGELISTOVLPicture.ImageOvlAn image list entry with an overlay image index.
SFT_PICTURE_IDISPATCHPicture.IPicDispAn OLE picture object accessed through IPictureDisp.
SFT_PICTURE_IPICTUREPicture.IPicAn OLE picture object accessed through IPicture.
SFT_PICTURE_GDIPLUSPicture.GDIPlusImage.lpImageObjectA GDI+ image (PNG, TIFF, JPEG, GIF, EMF+).
SFT_PICTURE_NETPicture.NETImage.pUnknownA .NET System.Drawing.Image reference.
SFT_PICTURE_AVIPicture.hwndAnimAn AVI clip hosted in a Microsoft Animation control. The HWND of the animation control.
SFT_PICTURE_COLOR_SAMPLEPicture.ColorSampleA solid color swatch with optional border. Width / height / sample color / frame color.
SFT_PICTURE_SIZEONLYPicture.DimensionA layout placeholder that reserves space but draws nothing.
SFT_PICTURE_CBPicture.CheckBoxA two-state check box glyph (state 0 / 1).
SFT_PICTURE_CB3Picture.CheckBoxA three-state check box glyph (state -1 / 0 / 1).
SFT_PICTURE_RBPicture.CheckBoxA radio button glyph.
SFT_PICTURE_UPDOWNPicture.CheckBoxAn up / down arrow glyph.
SFT_PICTURE_UPDOWNSORTPicture.CheckBoxA sort-direction indicator (up = ascending, down = descending).

Functions

FunctionDescription
Sft_InitPictureZero a SFT_PICTURE so it represents an empty slot.
Sft_ClearPictureReset a SFT_PICTURE without releasing the resources it referenced.
Sft_CopyPictureCopy one SFT_PICTURE to another (handles / COM pointers copied verbatim).
Sft_IsPictureReturn TRUE if the slot is non-empty.
Sft_IsPictureBitmap / Icon / etc.Type-specific predicates - one per supported picture type.
Sft_SetPictureBitmapStore an HBITMAP.
Sft_SetPictureIconStore an HICON (any size, 16x16, or 32x32 variants).
Sft_SetPictureImageListStore an image list reference (with or without overlay).
Sft_SetPictureColorSampleStore a color swatch.
Sft_SetPictureIDispatchStore an IPictureDisp pointer.
Sft_SetPictureIPictureStore an IPicture pointer.
Sft_SetPictureAnimateStore the HWND of an AVI animation control.
Sft_SetPictureSizeOnlyStore a dimension-only placeholder.
Sft_SetPictureCheckBoxStore a two-state or three-state check box glyph.
Sft_SetPictureRadioButtonStore a radio button glyph.
Sft_SetPictureUpDownStore an up/down or sort-direction glyph.
Sft_SetPictureGDIPlusImageStore a Gdiplus::Image* pointer.
Sft_SetPictureNETImageStore an IUnknown* for a .NET image.
Sft_GetPictureSizeReturn the picture's pixel width and height.
Sft_InitTextZero a SFT_TEXT structure.

Constants

Constant familyPagePurpose
SFT_PICTURE_*Picture type constantsSelects which member of SFT_PICTURE.Picture is meaningful.
SFT_PICALIGN_*Alignment constantsHorizontal and vertical alignment for pictures and text within a slot.
SFT_ORIENTATION_*Orientation constantsHorizontal vs vertical text orientation.
SFT_PICFLAG_FREESFT_PICFLAGInternal ownership marker on SFT_PICTURE.flag1.
SFT_IMAGEOVL_GHOSTEDSFT_IMAGEOVLStyle flag for the image-list overlay variant.
SFT_NOCOLORSFT_NOCOLORSentinel COLORREF meaning "use the default".
SFT_TEXT_*Text flagsSelection-outline / background flags on SFT_TEXT.flag2.
SFTPICTURE_VERSIONSFTPICTURE_VERSIONHeader revision identifier.

Structure layout

StructurePagePurpose
SFT_PICTURESFT_PICTURE StructureImage / picture / glyph descriptor.
SFT_TEXTSFT_TEXT StructureText label descriptor (caption, font, color, alignment, GDI+ hints).

Resource ownership

Resources stored in a SFT_PICTURE - HBITMAP, HICON, HIMAGELIST, IPicture pointers, GDI+ Image objects, .NET IUnknown pointers, animation HWNDs - remain owned by the application. The helper functions never destroy handles or release COM references. Sft_ClearPicture only zeroes the structure. The application must keep its resources alive for as long as a SftXxx control might use them (typically until the control is destroyed) and is responsible for releasing them itself.

Per-product caveat

Not every DLL product supports every picture type. SftButton/DLL accepts SFT_PICTURE_GDIPLUS, SFT_PICTURE_BITMAP and SFT_PICTURE_ICON for its image slots; SftTree/DLL adds SFT_PICTURE_CB / RB / UPDOWN glyphs for its built-in cell renderers; SftTabs/DLL accepts a smaller subset for tab-label images; and so on. Each per-product help file lists the supported types for that product's image fields.


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