PixMaps and Images

BlitzMax Forums/BlitzMax Beginners Area/PixMaps and Images

Berbank(Posted 2005) [#1]
Hi,

Can anyone point me to a post/site that explains when/how and why to use PixMaps? Or even better write a nifty little program that shows a few of its merits? I really don't know where to start and I'm sure this is a topic that everyone would like some clarification on (pending lovely documentation)

Cheers,
b


EOF(Posted 2005) [#2]
In a nutshell,

Images are suitable for game sprites. They allow for realtime rotation, flipping, scaling, alpha, and various blend modes. They are hardware accellerated.

Pixmaps are sutiable for static backgrounds (loading screens) and pixel manipulation (via ReadPixel/WritePixel). They reside in the system memory and therefore not suitable as game sprites. However, they can be saved via SavePixmapPNG.


Berbank(Posted 2005) [#3]
Thanks Jim,

Are there any special things I should know about moving from one format to another? And would it be wise to use a full screen PixMap for post processing of an image? I miss the simplicity of moving to an image buffer and haven't got to grips with how fast using a Pixmap is and what are the pitfalls of playing with it.

Cheers,
b


Ferminho(Posted 2005) [#4]
I'd say the main drawback of using pixmaps is that they're *very* slow. If you draw a fullscreen pixmap each frame you will suffer heavy fps loses in most machines.
I would use pixmaps for images that, either aren't going to be drawn each frame, or are small and few but they need to be changed realtime (and a lot of times, maybe one per frame).

Or else, use them at specific times - for example, converting a TImage to TPixmap, modifying it, and then back to TImage - it's "slow" too but only once, and not as slow as drawing a pixmap every frame.


Berbank(Posted 2005) [#5]
Great, thanks for the advise. I've been playing with them a bit and what you say is right on the money. I'm looking into how to do fast screen effects, it looks like this won't be fast enough so I'll go back to looking into using image blends. Thanks again.