Skip to Menu Skip to Content Skip to Footer

Tuesday, Jun 27th

Marquee Delphi
Written by Administrator   
Tuesday, 21 June 2011 16:23


Not long ago, I stood in front of goal, the development of the marquee. To his surprise, found that the internet there is no more or less bearable implementation. All the options I found were based on GDI and moved jerkily across the screen, with an unpleasant flickering.

Here are some of the components tested by me:

TSecretPanel (package RXLib)
Perhaps the best features of the components, including those that came into my hands.
You can not just move the line, but the text direction of the vertical and horizontal, it is possible to adjust the speed and color. Due to the fact that the component is derived from TCustomPanel, it is not difficult we add to any place in your application. However, display options row to be improved.

JvScrollText (package JEDI VCL)
The positive in this masterpiece only that he's just written works and is open source. The latter is not as much as anything useful in it I could not be found.

TMarquee (Microsoft Office)
Third place is an ActiveX object TMarquee. Set it easy:

    Open the Import Type Library ...
    Find the Marquee OLE Control Module.
    Click Install ..., not forgetting to specify the package to install, then click Compile the module is ready for use.

But working with him very easily. Component is not adapted for use in Delphi
and has all the disadvantages of the previous ones, plus the fact that it is not OpenSource.


Unfortunately, the running line can only be created manually, but this is not such a trivial task as it might seem at first glance. Why is it so famous software developers did not work out, the answer is:
All of them used a dead-end version of the GDI, then when it was necessary to use DirectX or OpnGL.
In DirectX, so that the string does not have flickered, there is a useful feature
WaitForVerticalBlank, which allows you to synchronize the frame rate to vertical refresh rate monitor., This removes flicker when scrolling line. However, because this may decrease performance, sometimes quite significantly. Maximum FPS with this is a refresh rate of your monitor, that is, unless your monitor has a frequency of 60 hertz, more than 60 frames per second line does not run.

The solution of the problem.

So, how quickly do the line to deal with DirectX is not rewarding, and of little interest. One solution, which optimizes the use of the library this problem at the moment I have found two solutions to optimize the work of DirectX:

1 Andorra 2D - allows the same code is used for both DirectX and for OpenGL, has components and is supplied as a set of classes and functions.

2 DelphiX - works only with DirectX, and works quite well, is designed as a set of components and supports all versions of Delphi.

After reviewing both the library decided to use option number 2, perhaps because it was already ready example (Demo_dxfont), the fact that I needed. Create a component-based sample was not difficult, of course it requires a set DelphiX.