Hello very one,,
I tired in search for using CXTButton with CXTPGraphicBitmapPng so please help me if you can.
I know that there are many way to load CXTButton with icon or bitmap, but I want to use PNG image in my CXTButton.
Why should I use it: after the success help of oleg to how draw a PNG image (PNG with alpha layer) correctly (see: http://forum.codejock.com/forum_posts.asp?TID=7402 - http://forum.codejock.com/forum_posts.asp?TID=7402 )
I used it in my own controls, some of these PNG are like icons in size (48x48) so for reduce the size of my resource and help my program to execute rapidly (use the preloaded image in my CXTPGraphicBitmapPng objects), I decided to use these CXTPGraphicBitmapPng but when I try to add it in CXTButton, I fail, the two function used in CXTButton to set icon or image are:
BOOL SetBitmap( CSize size, UINT nID, BOOL bRedraw = TRUE);
And
BOOL SetIcon( CSize size, HICON hIcon, HICON hIconHot = NULL, BOOL bRedraw = TRUE);
BOOL SetIcon( CSize size, UINT nID, UINT nHotID = 0, BOOL bRedraw = TRUE);
BOOL SetIcon( CSize size, LPCTSTR lpszID, LPCTSTR lpszHotID = NULL, BOOL bRedraw = TRUE);
BOOL SetIcon( CSize size, CXTPImageManagerIconHandle hIconHandle, CXTPImageManagerIconHandle hIconHotHandle, BOOL bRedraw = TRUE);
I can't use the first one because my Images are stored externally, so I try with SetIcon (exactly with the last one), I think to convert my CXTPGraphicBitmapPng to CXTPImageManagerIconHandle, or create CXTPImageManagerIconHandle object by using CXTPGraphicBitmapPng as HBITMAP but it can't be helped
What I want:
1- If possible how I can set image for CXTButton using CXTPGraphicBitmapPng;
2- How I can set CXTButton image (this image is PNG sorted externally in Dll file);
3- How I can create a valid icon with alpha layer using CXTPGraphicBitmapPng;
4- Is CXTButton support icons with alpha layer, if not how I can use it with these icons;
Note: all my PNG files are images with alpha layer and sorted in resource file externally this resource file is a Dll file.
Thanks to every one ...