Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Optimized storage of 1BPP images
Re: Optimized storage of 1BPP images [message #14034 is a reply to message #14033] |
Thu, 07 February 2008 13:47 |
cbpporter
Messages: 1401 Registered: September 2007
|
Ultimate Contributor |
|
|
I had a similar problem with my image scrolling control. Performance was reasonablly good, but when scrolling, it felt like some weight was holding you back and it felt plain wrong to use.
I fixed this by creating a permanent preallocated image, the size of the screen, and using it as a back buffer. When zooming for example, you only draw a zone zoomed on the backbuffer, and simply draw a portion as large as the parent control from the backbuffer. Not having to create Image objects on each redraw gives great performance boost. I don't know if this applies to you needs.
About number 2, I don't really know. U++ Images are in RGBA format, and it would be quite some effort to add support for other formats too. With WinAPI (if under win), you could easily put together a 1 bit bitmap, and on Paint, get the HDC and blit it, but of course this is not platform independent. Under X I think that working with image buffers is a little more natural, but I have no details.
|
|
|
Goto Forum:
Current Time: Wed May 08 16:49:02 CEST 2024
Total time taken to generate the page: 0.02417 seconds
|