Nicholas Gessler wrote in message news:3b70065b_1@dnews...

> Using the image component, I was trying to make the image glide (float)
> across the screen. So I set up a timer that incrementally moves the top and
> left properties of the image. The timer quits when the image reaches the
> screen center (it is disabled). This all works, but the image flickers as
> it passes over other stationary images. The image is a .bmp and is
> transparent. Can anyone tell me how to program flicker-free movement? I am
> trying, to some extent, to emulate some of the emulation in Flash.

I spent a while trying way back, but eventually gave up on using multiple TImage objects. These days I use TBitmap objects to hold images and draw my screen into, then CopyRect to move the data to a TPaintBox on-screen. It's a bit more work, but since all of the image compositing is done off-screen there's little or no flicker - none if it's done right.

Here's what I'd suggest...

Create a Graphics::TBitmap for each image you're using, one for your composite image, and a final one for the screen image. When the on-screen image needs to change, clear the composite bitmap and draw all of the images onto it. When that's done copy the composite to the screen bitmap, then update the TPaintBox. Don't forget to handle the TPaintBox's OnPaint event - that's the reason for seperate composite and screen bitmaps.

If that doesn't eliminate 99% of your screen flicker immediately then there's something strange happening :>

-- Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur."


If you decide to do it the way Corey suggests, then I recommend making use of the following free VCL component package
'VTI Super-Graphics package'
http://members.tripod.co.uk/vantumour/products.htm

It contains an enhanced TBitmap and TPaintBox for exactly this sort of stuff.

HTH -- Van Tumour