Hello,
how can I get the PNG image from an ImageList?
I used to work with TPngImageList and I had the code:
ImageList.PngImages.Items[4].PngImage
Now I switched to cxImageList and I can't find a way to work with it.
Thanks
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi George,
You can handle the ImageList's GetImage or GetImageInfo method. Just use the following code:
Please refer to the "TcxImageList.GetImage" and "TcxImageList.GetImageInfo" topics of the ExpressQuantumGrid help for detailed information.
Thanks,
Eugene
This it TBitmap not PNG file. PNG has more features like alpha channel (32bit transparency) etc.
Hi George,
By design, the cxImageList first converts loaded images to bitmaps. All the bitmap's information, such as AlphaChannel, is stored separately and can be accessed by the GetImageInfo method. You can see it in the implementation of the cxImageListEditor's AddImages method (cxImageListEditor.pas).
As a workaround, you can use the GetImageInfo method to get a stored image's info and manually convert stored bitmaps to PNG files. An image bitmap and transparency mask bitmap are returned via the AImage and AMask parameters of the GetImageInfo method. Note, that a bitmap, returned by the AImage parameter is a 32-bit bitmap, and you can use it instead of PNG. So, don't hesitate to use it in your application.
Please refer to the "TcxImageList.GetImageInfo" topic of the ExpressQuantumGrid help for detailed information. Feel free to contact us if you need any further assistance in this regard.
Thanks,
Eugene
Wow! Very very bad.
Now I can realise why you haved removed the old moto "improving developer experience"… ;)
I'll switch to the old traditional freeware PNGImageList. That will help me to go faster with my project.
Thanks
Hi George,
Do you mean that the images, obtained from a TcxImageList, look wrong? I just want to know why reverting to a PNGImageList looks better for you.
Thanks,
Serge
I mean that for PNGImageList I have to write a single line to get the image (PNG) but in your ImageList I have to wrote dozen of lines.
The problem with me is that I have hundred of images to get from Image List and I have to make all those image transalation to get what I want.
Too bad and that doesn't improve "my developer experience".
George,
I'm sorry if my answer was unclear, but do you actually need PNG images? Do the bitmaps, retrieved from a cxImageList, look wrong or lack any effect? Could you please elaborate on this. We always do our best to improve our components, and your input would be very helpful.
Thanks in advance,
Serge
Hello,
yes it has a great difference.
Look at this Image in two version. PNG and BMP.
With BMP it loses its alpha channel that's why I need the PNG object, not the TBitmap.
Thank you for the information, George. From our point of view, using this bitmap in a graphical editor, to generate this picture, cannot correctly illustrate whether the bitmap is correct or not. If you would paint it on any canvas by means of the cxDrawImage procedure (cxGraphics.pas), you'd obtain the same results as in the bottom PNG image. I.e. using the bitmaps, fetched from a TcxImageList, as glyphs for VCL controls should give you the desired appearance. The easiest solution is to link a control to the ImageList, and specify its ImageIndex property value.
If you wish to utilize these bitmaps for other purposes, please describe your goal in greater detail.
Thanks,
Serge