T O P I C R E V I E W |
pierrotsc |
Posted - Mar 05 2012 : 08:40:52 I am trying to find out the length of a text object to be able to center the string in my imageenview. I use ObjWidth[-1] := length(ObjText[-1]);
my objtext can be different strings. I used showmessage(inttostr(ObjWidth[-1])); to see the length of my string and i get a value of 49 when it should be more like 700.
What am i doing wrong? Thanks. P |
3 L A T E S T R E P L I E S (Newest First) |
fab |
Posted - Mar 06 2012 : 00:17:40 StretchTextRect is available from 4.1.0.
ObjectsExtents specifies the overall (for all objects) space needed to contains all objects (their bounding boxes). You could estimate the text width using TCanvas methods (setting the same font and using TextWidth method). |
pierrotsc |
Posted - Mar 05 2012 : 14:40:28 do not see it in 3.1.2. Is that a new command? could i use ObjectsExtents instead? Thanks. P |
fab |
Posted - Mar 05 2012 : 11:31:29 ObjWidth specifies the width of the object bounding box, that has nothing to do with the length of text. You could use the method TImageEnVect.StretchTextRect to stretch the bounding box rectangle to the size (width and height) required to fit the text. |