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


Class: none
Declaration: procedure DrawMarkOnCanvas (const canv: TCanvas; Mark: byte; x, y: integer);

The method DrawMarkOnCanvas draws a mark on the canvas canv at the position (x,y). The position has to be specified in pixel coordinates (top/left is 0/0). The shape of the mark is defined by the parameter Mark:

DrawMarkOnCanvas can be used to draw on any canvas exactly the same marks as created by the methods MarkAt of the units RChart, Rot3D, and PolChart, or the OnImageReqest event of TThumbnails. It can be used to create, for example, a legend of data marks.

If the parameter mark is greater than MAXCANVASMARKS, a character corresponding to its ASCII code is displayed instead of a symbol. Digits can be drawn by setting mark to the codes 200..209 (200 = '0', 209 = '9').

Example: This procedure is used in the following example program (see for downloading the code): rclegend

Hint: Due to a bug in Delphi 2005 (.NET only) the filled symbols cannot be drawn correctly. This bug occurs only under the .NET environment, under Win32 the property DrawMarkOnCanvas works as expected.

As of January 2005, there is no known work-around for this bug. If you need the full palette of symbols, you have to use Win32.

Last Update: 2013-May-15