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
 Imageenvect.objfontangle an Text with frame
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - Feb 03 2012 :  06:17:55  Show Profile  Reply
Hello,
if I generate a text with frame,
and set Imageenvect.objfontangle[obj]:=45 or 67 ...
then runs the text out of the frame.
What can I do, that the text inner the frame


27.79 KB?

Klaus
www.klausdoege.de

fab

1310 Posts

Posted - Feb 03 2012 :  14:27:01  Show Profile  Reply
Hello,
there isn't a way to calculate the required rectangle size programmatically, you have to resize the rectangle using the mouse to match the right size. It is important that ObjTextAutoSize=false.
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Feb 03 2012 :  15:40:40  Show Profile  Reply
Hello Fabrizio,
-> Imageenvect.objtextautosize := false;
that was the right tip.
Now, it works out great.


31.38 KB
And here my tip for the calculation of the objectborder.
Example:
ImageEnVect.ObjText[obj]:= 'Your Text...!';
ImageEnVect.ObjTextAlign[obj] := iejcenter ;
ImageEnVect.SetObjFont(obj, MyFont);
ImageEnVect.ieBitmap.Canvas.Font := MyFont;
tewi := ImageEnVect.ieBitmap.Canvas.TextWidth('Your Text...!');
tehi := ImageEnVect.ieBitmap.Canvas.TextHeight('Your Text...!');
if mytextangle<>0 then // calculate a new Objheight
tehi:= trunc(tehi + (tewi * sin(mytextangle * PI / 180)));
ImageEnVect.ObjHeight[obj] := tehi;
ImageEnVect.ObjWidth[obj] := tewi;


Klaus
www.klausdoege.de
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: