Example 1: |
Following is an example on how to implement user defined graphics on top of the SmithChart data. It displays the text HALLO twice, one text is positioned at absolute coordinates (120,120), the other text is drawn relative to the world-coordinates at position [0.4, 0.8]. Note that the method R2M returns coordinates relative to the chart window (and not relative to the data area); you have therefore subtract Top and Left before positioning the graphics.
procedure TForm2.SmithChart1DataRendered (Sender: TObject;
Canvas: TCanvas; Top, Left: integer);
var
xout,yout: longint;
begin
canvas.Font.Color := clBlue;
Canvas.TextOut (120,120,'HALLO');
SmithChart1.R2M (0.4, 0.8, xout,yout);
Canvas.TextOut (xout-Left, yout-Top,'HALLO');
end;
|