Page 1 of 1

PostPosted: Mon May 20, 2002 9:33 am
by WauloK
I am using two bitmaps, at the moment (154x100) in size. One is the main image and the other is plain black (for erasing the previous image).
I want to bounce the main image bitmap around the screen, but wiping it with FastBmp() leaves it flickering rather than moving smoothly.

I've tried creating a buffer and only drawing in that, then copying that to the Palm screen, but I fear it is slow to draw (no doubt since the image is so large).

Is it possible to do this smoothly, or do I need smaller bitmaps?

The code draws the main image, sleeps for 50ms then draws the black image over the top.

Funky groovy PocketC support site.
Iron Filings v2.0 released.
Download a demo version at
Made with PocketC!

PostPosted: Mon May 20, 2002 12:48 pm
by jstadolnik
There's not much you can do other than use a scratch buffer or two to smooth things out, but as you pointed out can slow things down further. Though the blitting is reasonably quick. Palm devices just aren't that fast. You would hit the same problem no matter what development platform you used... well, a re-write of the blitter code in assembly would probably help.

There's one trick I'm aware of... if you keep you bitmap's width of multiple of 16, and if you draw only on horizontal positions divible by 16 (0,16,32, etc), you should see a speed up.

You might want to check out the map_demo.c file in the PToolbox release. It uses buffering with an even bigger bitmap. Also, check out the graphics.c file. It shows a number of buffering techniques.


The PToolboxLib guy.

Edited by - jstadolnik on 05/20/2002 14:33:10