Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very smooth scrolling label

Status
Not open for further replies.

poltadi

Programmer
Sep 2, 2011
2
0
0
LV
Greetings!

I am new with Delphi. And I can`t solve one problem for few weeks already. My goal is to make a Label scroll when I move mouse over it. There are many exapmles on the internet about scrolling labels (example: but here`s the problem: how do I make it scroll smooth, so that eye couldn`t spot the flickering.

I appreciate any help.
Thanks!
 
You'll want to see if you can turn on DoubleBuffering. Look up that topic for more information or others who know more might be able to chime in.
 
I have been becoming very familiar with this subject lately, and have learned the best solution for avoiding flickering. Don't draw directly to the control's canvas. Create a bitmap in the background, do all your drawing on this bitmap, and as needed, just draw this bitmap to the control's canvas. That avoids any flickering.

JD Solutions
 
I have drawed it like that - not directly on the canvas, instead on the bitmap in the background. But it`s still notable that the text is moving one pixel at a time. How do I make it slide smoothly?
 
At the moment I myself am dealing with similar issues, and I'm solving some of my problems by converting my calculations to use Single instead of Integer. It helps keep things working on a finer scale to avoid jumping around. Not sure if it may help in your case, but if you are able to post a sample of how you're drawing, it can be fixed much easier. Sometimes it could be something real simple, like clearing the canvas before drawing - if you don't clear the canvas first it won't flicker.

JD Solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top