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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to get TextOut to wrap text to fit it on Image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
730 Posts

Posted - Nov 18 2015 :  04:03:31  Show Profile  Reply
I am using text out to print text on ImageEn.

ProjectDetails := '';
  ProjectDetails := ProjectDetails + 'Project Name: ' + txtProjectName.Text;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Project Comments: ' + txtComments.Text;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Project Type: ' + ProjectTypeName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Project Settings: ' + ProjectSettingsName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Project Options: ' +
    ProjectSettingsSubOptionsName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Other Settings:';
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Size:' + ProjectSizeName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Paper:' + ProjectPaperName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Cover:' + ProjectCoverName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Binding:' + ProjectBindingName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Coating:' + ProjectCoatingName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Sub Product: ' + ProjectSubProductName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + 'Starts From: ' + ProjectStartsFromName;
  ProjectDetails := ProjectDetails + #13;
  ProjectDetails := ProjectDetails + '--------------------------'


I am using the following code to print the text in ImageEn

ieMain.Proc.TextOut(10,10,ProjectDetails,'Arial',16,clBlack,[],0,True,True);

The text is printing in one straight line instead of multiple lines.

Again this TextOut is not wrapping the text to fit withing the image from right side.

If I set last parameter to False then the text that falls out side of image width gets truncated.

My question is how can I get the Text to wrap around?

TIA



Yogi Yang

xequte

39108 Posts

Posted - Nov 18 2015 :  16:49:40  Show Profile  Reply
Hi Yogi

TImageEnProc.TextOut() does not support multiple lines of text.

Either make multiple calls to TextOut for each line of text (using TCanvas.TextExtent() to establish the next Y value) or use a TImageEnVect memo object and then copy it to the background image:

http://www.imageen.com/help/TImageEnVect.CopyObjectToBack.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

yogiyang

India
730 Posts

Posted - Nov 19 2015 :  02:11:09  Show Profile  Reply
Nigel,

Thanks for reply.

I checked out EditMemo object help but it says undocumented.

So how do I use this.

Can you please guide me?

TIA



Yogi Yang
Go to Top of Page

xequte

39108 Posts

Posted - Nov 19 2015 :  17:03:02  Show Profile  Reply
Hi Yogi,

Not EditMemo, but an object of kind iekMemo:

http://www.imageen.com/help/TImageEnVect.ObjKind.html

Please see the vectorial demo to get a better understanding of TImageEnVect. Of course you will be creating and adding the memo programatically, so also consult the "Object Properties" at:

http://www.imageen.com/help/TImageEnVect.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: