Solution |
Assuming that you know which pixel position the text has to be placed at, you could use the OnDataRendered event to display a scaled text at this position. Here's a sample code of the event handler:
procedure TForm1.GM1DataRendered(Sender: TObject; Canvas: TCanvas);
const
FontNormSize = 12; // font size when magnification equals 1.0
var
p : TPoint;
begin
p.X := 200; // location of text in pixel coordinates (map reference frame)
p.Y := 100;
p := GM1.MapImageToControl(p);
Canvas.Font.Size := round(GM1.Magnification*FontNormSize);
Canvas.TextOut(p.x,p.y,'hello');
end;
|