Archive: What is the best way to display PNG files?


What is the best way to display PNG files?
Hello,

I need to display PNG graphics on the top right corner of the installer. I am using modern UI2 but with custom dialogs (so I create the dialog and populate it in code with whatever text and controls).

The installer needs to download in real time a png file and display it on the top right corner (think about it as a logo file for example). The file is PNG and includes transparency.

I have used ebanner succesfully to display such a file but it seems unreliable as it does not work on some machines while working on others.

Anyone known of a safe way to accomplish this? I wish there was a NSD_SetImage that could simple accepts a PNG but all these support bitmaps only.

Thanks!


You may consider embedding a png2bmp.exe converter.
This one is based on libpng, so it should not require any GDI+ or IImgCtx
However, standard BMP in Windows don't have transparency.


Wizou,

Thanks for the idea. I tried this, I run png2bmp using the ExecCmd plugin to make sure it runs in hidden mode. I set png2bmp to preserve transparency using 32 bit bitmap and then used NSD_CreateBitmap and NSD_SetImage to display the bitmap. At least on Windows 7 it seems that the bitmap transparency worked fine.