[Lazarus] Smooth scrolling label (marquee)

Luca Olivetti luca at wetron.es
Tue Nov 10 22:09:56 CET 2015

El 10/11/15 a les 18:47, Graeme Geldenhuys ha escrit:
> On 2015-11-10 16:43, Luca Olivetti wrote:
>> Impressive, but I looked at the source and it uses its own kind of
>> application.
> Don't let the demos confuse you. The demos were implemented to be
> cross-platform in their own way, with its own widgets used by the demos.
> The idea comes from the original C++ AGG framework, and only meant for
> the demos.
> You can use the AggPas API directly (most powerful) in Lazarus or fpGUI
> or Console applications. There is also a TAgg2D Canvas class which gives
> you a more Delphi-like Canvas API - a much smoother/easier introduction
> to AggPas. The TAgg2D canvas is available for LCL and fpGUI.

But in the end I have to render it on the LCL canvas (a simple 
TextRect), and I cannot do it faster than the LCL allows me. If I use a 
timer[**] I'm constrained by the timer resolution (around 15ms in 
windows with a minimum value of 10ms), if I use a thread+synchronize I'm 
constrained by how often the application loop calls CheckSynchronize 
(aside: if I move the mouse over the label, it goes faster, probably 
because the application is managing more windows messages and calls 
CheckSynchronize more often).
I also tried without Synchronize, but that's a no-no (apparently works 
until you hit a timing issue and the application crashes or gets stuck).

[*] there are also multimedia timers, but I don't know if/how I can use 
them, and they are windows specific anyway.

Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

More information about the Lazarus mailing list