![]() |
CXTPImageManagerIconHandle::CopyHandle |
Post Reply ![]() |
Author | |
rdhd ![]() Senior Member ![]() ![]() Joined: 13 August 2007 Location: United States Status: Offline Points: 899 |
![]() ![]() ![]() ![]() ![]() Posted: 02 March 2009 at 1:17pm |
I am calling CopyHandle and then GetBitmap.
For png based glyphs, the call to GetBitmap is returning a bitmap that appears to be blended to a background color that is black. I actually need it blended against a specific background color of a web page as we write out a bmp file that is referenced by the web page. With non-png based glyphs, I am able to spin thru the bitmap before I write it and change the backgound pixels to my desired background. But that doesn't work with the bitmap returned from GetBitmap if the underlying glyph is png because the pixels have already been blended (with black).
However I have found that CopyHandle calls CXTPImageManagerResource::CreateIcon. In that routine if I bypass the if (pRinfo->bAlpha) code and force the code in the else clause to run, I get a good bitmap. That is, there are no anomolies when the image is viewd on the web page. The anomolies we see are along the edges where the alpha plane has caused our image to blend to a black background (so we have black looking pixels along some "edges" in the image.
How can I get a consitent bitmap whether using png or not?
Do I need to find some code that writes a png or icon out and use those on our web page instead of bmp files? If so, then I have another issue. Whenever I call GetIcon (on the original or the copied icon handle object), the hIcon is always NULL so I have to call GetBitmap.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Think you can just call
HBITMAP AFX_CDECL CXTPImageManagerIcon::LoadBitmapFromResource(LPCTSTR lpszResource, BOOL* lbAlphaBitmap)
and load your png without put it to ImageHandle. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
rdhd ![]() Senior Member ![]() ![]() Joined: 13 August 2007 Location: United States Status: Offline Points: 899 |
![]() ![]() ![]() ![]() ![]() |
Images are loaded via LoadIconArray and are not individual images. When rendering a png to a bitmap, it would seem that the user really needs to be able to provide the background. There are a lot of functions to get icons, bitmaps and even draw into a dc so I will keep trying until I find a method that allows me to obtain the image I need. After all, you manage to draw the images on the command ribbon and tooltips without the black background (and blends to black) that I am seeing.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |