Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Ken Randall
Posted - Oct 20 2020 : 05:06:49 Hi,
I have an postal address (strings) that I want to write out to the canvas.
if the length of any line of text is too big I want to word wrap it onto the next line of the canvas and subsequent lines should be beneath this.
How can I achieve this.
Thanks,
Ken
Ken R
2 L A T E S T R E P L I E S (Newest First)
xequte
Posted - Oct 20 2020 : 19:51:18 Hi Ken
Actually you can just use TextOut with a rect parameter. It will automatically handle the wrapping:
// Draw text inside a rectangle of (100,100,200,200) auto-wrapping as necessary
ImageEnView1.Proc.TextOut( Rect(100, 100, 200, 200) , 'TImageEnProc provides image processing and analysis functionality to a TImageEnView, TIEBitmap, TImage or TBitmap component.' );
Posted - Oct 20 2020 : 07:25:32 Ok. I worked this out for myself:
Y:=30;
R:=TRect.Create(10,30,190,180);
for I:=1 to AddCount do
begin
S:=Uppercase(SL[I]);
if S<>'' then
begin
DrawText(S,R);
Y:=Y+MeasureText(S,R,0).cy;
R.Top:=Y;
end;
end;