Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TImage vs. TPaintBox

346 views
Skip to first unread message

James A. Schulz

unread,
Apr 14, 2000, 3:00:00 AM4/14/00
to
If I put a TImage in a TScrollBox, write something to it (using
Image1.Canvas.TextOut) and then scroll it away and back again...well the
text comes back again. However, if I use a TPaintBox instead of a TImage,
my text does not return when I scroll back again. Is there a drawback to
using TImage over TPaintBox that should prevent me from taking advantage of
this "free" scrolling behavior (which, of course, I need)?

thanks,

James

Davie

unread,
Apr 14, 2000, 3:00:00 AM4/14/00
to
TImage has a lot of advantages such as fast scrolling and you don't have to
worry about what areas to paint etc... Whereas the PaintBox requires you to
handle the painting yourself and usually ends up being a lot slower unless you
throw in a bunch of logic to determine what section to paint so you are
repainting the whole thing on each call to the TPaintBox ondraw method.
On the other hand a TImage uses exta resources than a TPaintBox would. So, if
you are only going to use a couple of them, then use the TImage, otherwise you
may want to think how you lay things out.

IE: You could have 3 TPaintBoxs that could refer to the same TImage, but
represents it in a different way whereas if you did it all with TImages, then
you would have many bitmaps assigned instead of one.


Davie

Rene Tschaggelar

unread,
Apr 15, 2000, 3:00:00 AM4/15/00
to
If the content of the image can be considered static, TImage is the choice.
If the content of the image is dynamic, such as a realtime signal or an FFT
of it, TPaintbox is the choice. With modern PC's, the resource aspect of TImage
moved to the background.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

0 new messages