The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....

Using TRotLab

There are many situations where labels are required which deviate from their usual horizontal orientation. The class TRotLab implements a label component, which can display text at any angle. Please note that rotated text can be displayed only with TrueType fonts. Thus you have to assign a suitable Font (e.g. Arial, but not MS Sans Serif). Further, the visual impression of an inclined text (whose text angle deviates from multiples of 90 degrees) can be largely improved by setting the AntiAlias property to TRUE.

The label component consists of the text to be displayed (property Caption) and the rectangular background area of the label. The color of the text is controlled by the Font.Color property, the color of the background by the Color property. The background may be switched into transparent mode by setting the Transparent property to TRUE. Please note that the transparency does not affect the frame of the label. In order to switch off the frame, the property FrameStyle has to be set to fsNone.

The angle of the text can be set by the property TextAngle (in degrees). The position of the text within the label area (the reference point) can be controlled by the properties PosX and PosY. Setting the AutoCenter property to TRUE automatically centers the reference point. Please note that for actually centering the rendered text the Alignment property has to be set to taCenter.

Last Update: 2013-Mai-14