SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Loads a GDI+ image from an application's or DLL's resources.
C
LPVOID SftTabs_LoadGDIPlusImageFromResource(HMODULE hInst, LPCTSTR lpszResourceType, LPCTSTR lpszResourceName);
hInst
The instance handle of the application or DLL containing the resource.
lpszResourceType
The resource type. Can be a string or an identifier using the MAKEINTRESOURCE macro.
lpszResourceName
The resource name. Can be a string or an identifier using the MAKEINTRESOURCE macro.
If successful, the return value is a Gdiplus::Image pointer or NULL if the function failed.
Loads a GDI+ image from an application's or DLL's resources.
This function is mainly intended for applications written using C. Because Gdiplus is C++ based, C applications don't readily have access to the Gdiplus::Image class and cannot use Bitmap::FromResource to load a GDI+ image. Using SftTabs_LoadGDIPlusImageFromResource even C applications can use GDI+ images, without needing access to GDI+ itself.
The application retains ownership of the Gdiplus::Image pointer returned by SftTabs_LoadGDIPlusImageFromResource. Once the image is no longer needed, it can be released using SftTabs_FreeGDIPlusImageLoadedFromResource, which frees the associated memory.
LoadGDIPlusImageFromResource provides essentially the same service as the GDI+ Bitmap::FromResource function.
Please note that GDI+ images cannot be defined as BITMAP resources. They must be included as custom resources. The Images sample demonstrates how this is accomplished.
g_hInst = hinst; SftTabs_RegisterApp(hinst); /* Register with SftTabs/DLL */ /* load the bitmaps/icons */ m_hImgList = ImageList_LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_TOOLBAR), 16, 0, RGB(255,0,0)); m_hSampleBitmap = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_SMILE)); m_hSampleIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON)); m_lpGDIPlusImage = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE)); m_lpGDIPlusImageHot = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE_HOT)); m_lpGDIPlusImageDisabled = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE_DISABLED)); m_lpGDIPlusUp = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_UP)); m_lpGDIPlusDown = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_DOWN)); m_lpGDIPlusLeft = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_LEFT)); m_lpGDIPlusRight = SftTabs_LoadGDIPlusImageFromResource(g_hInst, TEXT("PNG"), MAKEINTRESOURCE(IDR_RIGHT));
//}}AFX_DATA_INIT // Get the required bitmaps, icons m_SampleBitmap.LoadBitmap(IDB_SMILE);/* Load bitmap */ m_hIcon = AfxGetApp()->LoadIcon(1); m_hSampleIcon = AfxGetApp()->LoadIcon(IDI_ICON); m_ImgList.Create(IDB_TOOLBAR, 16, 0, RGB(255,0,0)); m_GDIPlusImage = (Gdiplus::Image*)SftTabs_LoadGDIPlusImageFromResource(AfxGetApp()->m_hInstance, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE)); m_GDIPlusImageHot = (Gdiplus::Image*)SftTabs_LoadGDIPlusImageFromResource(AfxGetApp()->m_hInstance, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE_HOT)); m_GDIPlusImageDisabled = (Gdiplus::Image*)SftTabs_LoadGDIPlusImageFromResource(AfxGetApp()->m_hInstance, TEXT("PNG"), MAKEINTRESOURCE(IDR_IMAGE_DISABLED)); } CMainDlg::~CMainDlg() { if (m_GDIPlusImage) delete m_GDIPlusImage;
See Also C/C++ API | C++ Classes | Notifications