🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #1232

Re: image component flickers during move

#1232
From: Corey Murtagh
Date: Tue, 07 Aug 2001 19:57
35 lines
2545 bytes
Nicholas Gessler <gessler@ucla.edu> 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."
Technical Details
Message-ID: <3b704835_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3b70065b_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,6c7e5eb3b70397cc
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2001-08-07 13:01:52 PST
From: "Corey Murtagh" <emonk@ihug.co.nz>
Newsgroups: borland.public.cppbuilder.multimedia
References: <3b70065b_1@dnews>
Subject: Re: image component flickers during move
Date: Wed, 8 Aug 2001 07:57:16 +1200
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 203.173.216.137
Message-ID: <3b704835_2@dnews>
X-Trace: dnews 997214261 203.173.216.137 (7 Aug 2001 12:57:41 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!news.maxwell.syr.edu!news1.optus.net.au!optus!intgwlon.nntp.telstra.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews