Saving icon to PNG file (GDI+)?
-
Hi guys, I'm trying to make a routine that save an icon (HICON) to png file with GDI+
Bitmap* bmp = new Bitmap(icon);
GetEncoderClsid(L"image/png", &encoderClsid);
bmp->Save(L"xxx.png", &encoderClsid, NULL);So far so good. But when I open the png ... it is not transluctant (semi transparent). Any ideas why??? And I found that GDI+ has A LOT of problems with icons :( P.S. If you have another suggestion how to do this, please share fragment of code.
-
Hi guys, I'm trying to make a routine that save an icon (HICON) to png file with GDI+
Bitmap* bmp = new Bitmap(icon);
GetEncoderClsid(L"image/png", &encoderClsid);
bmp->Save(L"xxx.png", &encoderClsid, NULL);So far so good. But when I open the png ... it is not transluctant (semi transparent). Any ideas why??? And I found that GDI+ has A LOT of problems with icons :( P.S. If you have another suggestion how to do this, please share fragment of code.
I'm not sure that you can do this directly as you suggest. Icons are 'special' file types that Windows understands and paints in a slightly different manner to ordinary bitmaps. Take a look at Icons in MSDN for more information.
-
Hi guys, I'm trying to make a routine that save an icon (HICON) to png file with GDI+
Bitmap* bmp = new Bitmap(icon);
GetEncoderClsid(L"image/png", &encoderClsid);
bmp->Save(L"xxx.png", &encoderClsid, NULL);So far so good. But when I open the png ... it is not transluctant (semi transparent). Any ideas why??? And I found that GDI+ has A LOT of problems with icons :( P.S. If you have another suggestion how to do this, please share fragment of code.