Flickering of two TImage

Flickering of two TImage

Post by Alex A » Tue, 07 Aug 2001 23:31:31



Hi!
I create an application, that use two TImage components in TScrollBox.
TImages have the same size and height and width and lie one above another. I
read BCBDev and set csOpaque of TImages & ScrollBox & Form to aviod
flickering. But:
1. when upper TImage->Transparent = true flickering is not visible but
LineTo method works too SLOW
2. when upper TImage->Transparent = false i see flickering so that lower
TImage becomes visible, and flickering is fast, LineTo works fast.
I try to draw on upper TImage with transparent = true and CopyMode = invert
so that lower TImage don't change. Becouse of it I use this construction.
Help me please!
Can anyone explain what's wrong?
 
 
 

Flickering of two TImage

Post by Yoto Yoto » Thu, 09 Aug 2001 02:13:11


Quote:> I create an application, that use two TImage components in TScrollBox.
> TImages have the same size and height and width and lie one above another.

That's a very bad approach.  There's no need for two TImage components
if the display area is the same.  The correct way to do this is to
create two TBitmap (which are non-visible objects), do the painting on
them, and once everything is done, draw one of the TBitmap on the TImage
component.

--
Yoto Yotov

 
 
 

Flickering of two TImage

Post by Corey Murtag » Thu, 09 Aug 2001 04:33:31



Quote:> > I create an application, that use two TImage components in TScrollBox.
> > TImages have the same size and height and width and lie one above
another.

> That's a very bad approach.  There's no need for two TImage components
> if the display area is the same.  The correct way to do this is to
> create two TBitmap (which are non-visible objects), do the painting on
> them, and once everything is done, draw one of the TBitmap on the TImage
> component.

I get the impression that he's using two overlayed TImage components to
provide foreground and background.  In which case I'd suggest 3 TBitmaps -
FG, BG and composite.

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

 
 
 

Flickering of two TImage

Post by Alex A » Thu, 09 Aug 2001 21:10:34


My English is not very well, but i try to explain.
It's something about copying. Lower TImage load bitmap, and upper ( it is
transparent  and the same size, left and top; CopyMode is SrcInvert; PenMode
is pmXor ) is used  to outline of contours of loaded bitmap with mouse (
with functions MoveTo and LineTo) and if contour is closed paint it ( use
Polygon ).If it is necessary to delete already existing object (contour) I
simply call Polygon once more ( so we can see lower "recovered" bitmap from
transparent image ). if I correctly understand, if i try to use offscreen
bitmap i will need to copy every step of mouse moving from offscreen bitmap
to timage's canvas. Is this not too slow?
 
 
 

Flickering of two TImage

Post by Yoto Yoto » Fri, 10 Aug 2001 07:35:14


Quote:> My English is not very well, but i try to explain.
> It's something about copying. Lower TImage load bitmap, and upper ( it is
> transparent  and the same size, left and top; CopyMode is SrcInvert; PenMode

I'm afraid I'm still not sure what exactly you're trying to do.  If I
understand correctly the lower TImage contains a bitmap and using the
upper transparent TImage you paint a contour.  To remove the flickering
you should never use two TImage components one over another.  Use only
one TImage.  You can paint the contour directly on it.  A TBitmap object
could be used to store your original graphic or to make different sorts
of offscreen image operations.

If you're still having problems, then post an example of your code and
we'll try to figure out something.

Good luck!

--
Yoto Yotov

 
 
 

Flickering of two TImage

Post by Rudijant » Mon, 03 Sep 2001 20:59:36



Quote:> > My English is not very well, but i try to explain.
> > It's something about copying. Lower TImage load bitmap, and upper ( it
is
> > transparent  and the same size, left and top; CopyMode is SrcInvert;
PenMode

> I'm afraid I'm still not sure what exactly you're trying to do.  If I
> understand correctly the lower TImage contains a bitmap and using the
> upper transparent TImage you paint a contour.  To remove the flickering
> you should never use two TImage components one over another.  Use only
> one TImage.  You can paint the contour directly on it.  A TBitmap object
> could be used to store your original graphic or to make different sorts
> of offscreen image operations.

> If you're still having problems, then post an example of your code and
> we'll try to figure out something.

> Good luck!

> --
> Yoto Yotov

 
 
 

1. Moving Timage over another Timage causes flickering ??

Hello NG,

I have a TImage that contains a bitmap (~1024X768).
I have another Timage (150X150) no bitmap loaded, that has transparent set
to true.

I draw an ellipse on the 150X150 Timage and then move 5 times per second by
setting its Top and Left Property.

Problem.... Every time I reposition (move) the 150X150 image over the larger
image, I get a flicker.

I've tried with and without calling Image.Update..... no luck.

How do I get rid of the flicker?

Thanks
Bryan

2. Help with X Files ... Please!

3. flickering TImage

4. quark xpress advert importing

5. How to avoid flicker on TImage?

6. iconeditor

7. TImage flickering

8. How do you center image?

9. TImage and TShape flickers

10. Reducing TImage flickering

11. Flickering TImage while resizing window

12. How to reduce flicker on a TImage ...

13. how to reduce flicker on TImage refresh