• Marc
  • Member Topic Starter

I wonder if it is possible to create overlay images at run-time using the vbalImageList?

Find attached an example database using the standard Mscomctl imagelist control. My intention is to use a reduced set of icons in an image list that can be combined on-the-fly, e.g. there are a couple of document types (offer, bill, delivery, bank account) and 4 status icons (new, ok, error, deleted).
Each status can be assigned to each document, i.e. 16 icons are needed to display the different statuses for each document. (in fact, there are much more document types and statuses available in different image resolutions).

To avoid creation of a huge pile of icons I thought it might have been a could idea to work with overlay icons.

As I'm already working with vbalImageList to display icons within iGrid it would be great if it also had an overlay method like standard imagelist control.
Is there a way to achieve this goal?

File Attachment(s): (49kb) downloaded 161 time(s).

vbAccelerator ImageList does not implement any overlay image creation techniques, so you need to prepare the required images outside of it and then upload them using one of its standard "AddFrom*" method.

However, after some research, I had one idea of how to do that automatically. But I have not managed to make it work. Maybe, I missed something, so I describe my idea below thinking others can tell me where I was wrong.

First of all, you need to upload your basic images into the standard MSComCtl ImageList OCX (like you do it in your sample). After that you prepare all combinations of your basic images using its Overlay method, but upload them into vbAccelerator ImageList OCX using the AddFromHandle method. The fact is that the MSComctlLib.ImageList.Overlay method returns an OLE Picture object, i.e. an object that implements the IPictureDisp interface. One of the members of IPictureDisp is the Handle property you can use with the vbalImageList.AddFromHandle method. It is also the default property, so I thought the following call should work:

vbalIml.AddFromHandle m_iml.Overlay("doc", "new"), IMAGE_BITMAP

Unfortunately, it just adds the 2nd image specified in the Overlay method ("new" in this sample)...

As a similar idea, you could try to experiment with uploading overlaid images into another temporary store like PictureBox and then uploading them into vbAccelerator image list using one of its methods.
I could see myself wanting to do something like this too, such as adding little #'s in a red circle in the top right of an icon, like on the iPhone or Facebook. In my case it's in an app and with real text, to make the # easier to change. I'll probably do this with some custom drawing using the 10Tec image list though.

But I could see myself wanting to do exactly what Marc mentioned.