BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reducing flicker when showing moving text

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Warrick Wilson
Guest





PostPosted: Sat Jun 05, 2004 10:21 pm    Post subject: Reducing flicker when showing moving text Reply with quote



I'm playing with the RunningText component from scalabium.com. It's an older
component (last date is 1999), but works reasonably well. However, I'm
trying on a large scale (full width of monitor, 15% of viewable area) -
trying to create a "marquee" or "running text" effect.

While it works, I get a LOT of flicker. I've done Google searches, and tried
a lot of the ideas from efg2.com's pages - put the component on a Panel, try
DoubleBuffered := true, ry addigng csOpaque to ControlStyle, etc. - but
there's still a lot of flicker.

We're using a freeware Java applet called ProScroll in some similar types of
situations, and it doesn't flicker like this. However, it doesn't go fast
enough to make people happy, so I was trying to create an ActiveX control
using this RunningText component.

Anyone have any suggestions on what else I might try, or on replacement
components to look at that produce a similar effect?

Both the applet and my new control will pause at different points when stuff
happens elsewhere on the screen .. I need to look at that later.

Thanks.


Back to top
Peter Below (TeamB)
Guest





PostPosted: Sun Jun 06, 2004 10:38 am    Post subject: Re: Reducing flicker when showing moving text Reply with quote



In article <40c247f3$1 (AT) newsgroups (DOT) borland.com>, Warrick Wilson wrote:
Quote:
I'm playing with the RunningText component from scalabium.com. It's an older
component (last date is 1999), but works reasonably well. However, I'm
trying on a large scale (full width of monitor, 15% of viewable area) -
trying to create a "marquee" or "running text" effect.

While it works, I get a LOT of flicker. I've done Google searches, and tried
a lot of the ideas from efg2.com's pages - put the component on a Panel, try
DoubleBuffered := true, ry addigng csOpaque to ControlStyle, etc. - but
there's still a lot of flicker.

The key to prevent excessive flicker is to *not* redraw the complete banner on
every step. Instead you use the ScrollWindow API function (or
TWincontrol.ScrollBy) to directly move the client area content one or two
pixels left and then you redraw only the one or two pixels column newly
exposed by this operation on the right. Do not use double-buffering with this
approach, it will only get in the way.

Quote:
Both the applet and my new control will pause at different points when stuff
happens elsewhere on the screen .. I need to look at that later.

If the control uses a standard TTimer to time the animation it will be blocked
if the process the banner is in does some lenghty operation in the main thread
that blocks the processing of messages. If another process is consuming a lot
of CPU capacity the timer messages may be delayed a bit, so the animation may
slow down. It should not stop completely under this condition, however.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Warrick Wilson
Guest





PostPosted: Mon Jun 07, 2004 5:23 pm    Post subject: Re: Reducing flicker when showing moving text Reply with quote



Thanks for the reply, Peter. I hadn't run across that method before, so I
wrote a simple program to try it out. As a result, I'm confused about how
that operates now, too....

I placed a panel on a form, and put two buttons on: one to shift by 2 pixels
left, one to shift by 2 pixels right.

I put a caption in my panel (Panel1.Caption := 'This is my text'Wink, made the
font bigger, colored the background, and ran.

When I scroll 2 pixels left, the movement is smooth. But I can't figure out
how I'm supposed to color the 2 columns of pixels that get "uncovered'. I
can scroll more, and the front of my caption disappears off the left side of
the panel.

When I start to scroll to the right, the stuff that was cut off is still
missing. Probably as expected, but I couldn't figure out how I'd put the
proper stuff back.

So then I tried putting an Image on the Panel, and seeing if I could scroll
that.

Nothing doing, although I'm sure it's operator error.

Can you point me at any examples that might show this technique you've
mentioned in action? Particularly if it involves filling in information on
the right as things "scroll off" to the left?

Thanks.

"Peter Below (TeamB)" <100113.1101 (AT) compuXXserve (DOT) com> wrote

Quote:
In article <40c247f3$1 (AT) newsgroups (DOT) borland.com>, Warrick Wilson wrote:
I'm playing with the RunningText component from scalabium.com. It's an
older
component (last date is 1999), but works reasonably well. However, I'm
trying on a large scale (full width of monitor, 15% of viewable area) -
trying to create a "marquee" or "running text" effect.

While it works, I get a LOT of flicker. I've done Google searches, and
tried
a lot of the ideas from efg2.com's pages - put the component on a Panel,
try
DoubleBuffered := true, ry addigng csOpaque to ControlStyle, etc. - but
there's still a lot of flicker.

The key to prevent excessive flicker is to *not* redraw the complete
banner on
every step. Instead you use the ScrollWindow API function (or
TWincontrol.ScrollBy) to directly move the client area content one or two
pixels left and then you redraw only the one or two pixels column newly
exposed by this operation on the right. Do not use double-buffering with
this
approach, it will only get in the way.

Both the applet and my new control will pause at different points when
stuff
happens elsewhere on the screen .. I need to look at that later.

If the control uses a standard TTimer to time the animation it will be
blocked
if the process the banner is in does some lenghty operation in the main
thread
that blocks the processing of messages. If another process is consuming a
lot
of CPU capacity the timer messages may be delayed a bit, so the animation
may
slow down. It should not stop completely under this condition, however.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be





Back to top
Warrick Wilson
Guest





PostPosted: Mon Jun 07, 2004 5:42 pm    Post subject: Re: Reducing flicker when showing moving text Reply with quote

I spoke too soon, except about the part about my problem being operator
error...

When I put the image on the panel, I had it resizing to fit the panel.
Oops...that made it always stay on the panel. I turned that off and suddenly
I can scroll the image off the panel, and the cool part is that the piece
that slides off comes back when I slide the opposite direction.

This may indeed work out very nicely.

"Warrick Wilson" <warrickw (AT) mercuryonline (DOT) com> wrote

Quote:
Thanks for the reply, Peter. I hadn't run across that method before, so I
wrote a simple program to try it out. As a result, I'm confused about how
that operates now, too....

I placed a panel on a form, and put two buttons on: one to shift by 2
pixels
left, one to shift by 2 pixels right.

I put a caption in my panel (Panel1.Caption := 'This is my text'Wink, made
the
font bigger, colored the background, and ran.

When I scroll 2 pixels left, the movement is smooth. But I can't figure
out
how I'm supposed to color the 2 columns of pixels that get "uncovered'. I
can scroll more, and the front of my caption disappears off the left side
of
the panel.

When I start to scroll to the right, the stuff that was cut off is still
missing. Probably as expected, but I couldn't figure out how I'd put the
proper stuff back.

So then I tried putting an Image on the Panel, and seeing if I could
scroll
that.

Nothing doing, although I'm sure it's operator error.

Can you point me at any examples that might show this technique you've
mentioned in action? Particularly if it involves filling in information on
the right as things "scroll off" to the left?

Thanks.

"Peter Below (TeamB)" <100113.1101 (AT) compuXXserve (DOT) com> wrote in message
news:VA.0000ae93.0073d42b (AT) nomail (DOT) please...
In article <40c247f3$1 (AT) newsgroups (DOT) borland.com>, Warrick Wilson wrote:
I'm playing with the RunningText component from scalabium.com. It's an
older
component (last date is 1999), but works reasonably well. However, I'm
trying on a large scale (full width of monitor, 15% of viewable
area) -
trying to create a "marquee" or "running text" effect.

While it works, I get a LOT of flicker. I've done Google searches, and
tried
a lot of the ideas from efg2.com's pages - put the component on a
Panel,
try
DoubleBuffered := true, ry addigng csOpaque to ControlStyle, etc. -
but
there's still a lot of flicker.

The key to prevent excessive flicker is to *not* redraw the complete
banner on
every step. Instead you use the ScrollWindow API function (or
TWincontrol.ScrollBy) to directly move the client area content one or
two
pixels left and then you redraw only the one or two pixels column newly
exposed by this operation on the right. Do not use double-buffering with
this
approach, it will only get in the way.

Both the applet and my new control will pause at different points when
stuff
happens elsewhere on the screen .. I need to look at that later.

If the control uses a standard TTimer to time the animation it will be
blocked
if the process the banner is in does some lenghty operation in the main
thread
that blocks the processing of messages. If another process is consuming
a
lot
of CPU capacity the timer messages may be delayed a bit, so the
animation
may
slow down. It should not stop completely under this condition, however.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be







Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.