ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnView Wrapping Multiple Lines of Text

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.' );


https://www.imageen.com/help/TImageEnProc.TextOut.html

Nigel
Xequte Software
www.imageen.com
Ken Randall 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;


Ken R