...draw multiple text lines on a Canvas?

Author: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch

Category: Graphic

procedure TForm1.Button1Click(Sender: TObject);
var
  
h, i: Integer;
begin
  
Image1.Canvas.Font := Memo1.Font;
  h := Image1.Canvas.TextHeight('Test');
  for i := 0 to Memo1.Lines.Count - 1 do
    
Image1.Canvas.TextOut(0, i * h, Memo1.Lines[i]);
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base