This message was edited by Manning at 2002-11-25 15:4:43
: Hi Everone!
: Does anyone know how to put text on a TImage using textout?Would be very greatfull of any help that you could give me!
This would write the words "This is a test" at pixel position 10,10 (relative to the top left corner) with white text on a black background:
Image1.Canvas.Font.Color := clWhite;
Image1.Canvas.Brush.Color := clBlack;
Image1.Canvas.TextOut(10, 10, 'This is a test');
Oh, one thing to note. Anything you write directly to the canvas in this way will be erased when the TImage repaints itself (ie: when you minimize and restore the application). So you'll have to remember anything you've written to the canvas, and override the OnPaint method to redraw everything the way you want it.