RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2015-03-13T21:38:06Z
Does the ImageList control support the PNG format?
Igor/10Tec
2015-03-14T06:29:17Z
As I know, this control does not support the PNG format. PNG was not so popular as now at the time of creation of vbAccelerator ImageList, and it requires special processing as it may contain alpha channel for 32-bit icons. It was not possible to process all those things correctly in the era of Windows 9x ๐Ÿ™‚
KomodoLabs
2017-01-04T14:30:20Z
I know this is an old post, but I'd like to vote to add PNG format as well. There are tons of PNG icons online, and I'd say 80-90% of them are PNG format so that they work with more apps. Maybe things have changed since then and this should be considered. I know I'd use it a LOT and I bet others would too.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-03T01:00:46Z
Are you considering adding PNG support or is this not planned?

Thanks.
Igor/10Tec
2017-06-06T09:20:42Z
I returned to this problem again, trying to find a feasible way to implement this today.

vbalImageList control is a wrapper for the native Windows ImageList functionality. If you look inside the control's source code, you'll see that images from bitmap graphics files are added to the internal image list using the ImageList_AddMasked  WinAPI function. It expects a WinAPI bitmap handle we obtain with another WinAPI function LoadImage .

The problem is that LoadImage does not support the PNG format. We need either to write our own decoder of PNG files that converts them into a compatible bitmap expected by the image list or use an external library like Windows Imaging Component for this. In the latter case, this means that we need to download and install a special package to our pc. See also this discussion on StackOverflow:

How would I load a PNG image using Win32/GDI (no GDI+ if possible)? 

At the moment, I think none of this option is applicable to vbalImageList.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-06T16:07:04Z
I understand. Thanks for looking into it.
Igor/10Tec
2017-06-07T12:31:18Z
Wait a little bit ;)

I did not want to give up so simply, so I started to communicate with other pro's who had worked with this problem. As a result, I've already implemented one first rough solution that allows us to upload 32-bit PNGs with translucency into the ImageList control.

Give me some time, and I'll wrap it into a new version of the control you can test.

One 'restriction'. Is it ok if this new feature will work only in Windows Vista or later versions of the OS? IMHO, it's Ok.
Igor/10Tec
2017-06-07T15:02:10Z
Raymond, I have managed to find a way to implement what we need. I sent you the link to the new version of the control to test in an email. Waiting for your feedback...
Igor/10Tec
2017-06-19T10:12:54Z
Well, we have recently released the version 2.5 of this ImageList control with the built-in ability to upload 32-bit PNG images with translucency. It can be done both at design time and at run time.
RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2017-06-19T17:00:47Z
Where do I download the latest version?

Thanks.
Igor/10Tec