PDA

View Full Version : Advice required re storing thumbnails in video memory...



Mark Shaxted
03-21-2007, 06:24 AM
Hi, I'm sorry if this is posted in the wrong forum...

I have a photo browsing/editing application I'm working on, which basically caches large numbers of thumbnails in PC memory (as ~12kb jpegs) and converts to bmps on the fly when they need to be displayed on screen as the user scrolls up & down. I can't store as RGB bmps because each would require ~142kb, and I need potentially several thousand in memory at a time.

It then dawned on me that I'm missing a trick here - why not use OpenGL to upload to video memory, and use the hardware features present.

The thumbnails will either be shown against a black background or, alternativley , within a surrounding area (think film slide) with certain exif data around the edges. This will require GDI for font smoothing.

My question is, what is the best strategy to use bearing in mind I want to maximise the graphics memory as much as possible, but performance isn't too critcal here (as long as a user can scroll quickly and smoothly). Should I be rendering directly into the window and adding text over the top? Drawing to bitmap, and retreiving the bitmap for Windows to blit onto the screen? Any other options?

One more thing comes to mind - how easy is it convert between different colour spaces in opengl?

Some things to bear in mind:
I must be able to use multiple monitors.
I can't use fullscreen rendering, as I'll simply be rendering into a child window.

Many thanks
Mark

Mark Shaxted
03-21-2007, 06:28 AM
Nearly forgot...

For lower end machines with limited (or no) graphics memory, what is the easiest way to tell if the graphics driver is using system memory to store the images? I assume this would be a very slow process to upload each image as required rather than blitting with Windows.

Zengar
03-21-2007, 09:46 AM
I don't think it will work like you want :-/ It won't be hard to use OpenGL shaders to convert from JPG to RGB, but if you target lower end machines... Another problem is that OpenGL usually mirrors the texture data in the system memory, so you will save nothing.