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


Declaration:procedure UseForeignCanvas (ForeignCv: TCanvas; x, y: integer);

The method UseForeignCanvas assigns the canvas of another component to the internal drawing engine in order to be able to draw the scale on another component. The parameter ForeignCv contains the canvas of the external component, the parameters x and y control the position of the scale on the external component. In order to reassign the internal canvas you have to pass a NIL value in the parameter ForeignCv.

Hint: If you use the TScale component to display a scale in your own component ("YourComp") you should create the scale in the constructor of YourComp and call UseForeignCanvase immediately after creating the scale:
   FScale := TScale.Create (self); 
   FScale.UseForeignCanvas (FGrafBmp.Canvas,0,0); 
   FScale.RangeLow := 0; 
   FScale.RangeHigh := 100; 
   ... (set more properties of FScale) 

Last Update: 2012-Oct-20