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....



OnBeforeScaleRendered


Unit:SDL_scale
Class: TScale
Declaration: property OnBeforeScaleRendered: TScaleRenderedEvent;
{ TScaleRenderedEvent = procedure (Sender: TObject; Canvas: TCanvas) of object; }

The OnBeforeScaleRendered event occurs immediately before the scale will be drawn. Use the property Canvas to draw user specific elements.

Hint 1: Please note that anything drawn on the canvas will be overwritten by the scale ticks and scale marks. If you want to draw on top of the scale ticks/marks you have to use the OnAfterScaleRendered event.

Hint 2: In order to avoid unwanted size effects regarding characters displayed on canvases of different resolution (i.e. the screen and a printer) you should never directly assign the font size within the event. Use SetCanvasFontSizeScaled instead. So, for example, the statement Canvas.Font.Size := 12; should be replaced by SetCanvasFontSizeScaled (Canvas, 12);

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code):scalemeter



Last Update: 2012-Oct-26