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
 iekRuler

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
John Posted - Apr 17 2012 : 21:30:46
Hello

With an iekRuler object, the location of the displayed ruler length (the length displayed as text) can be defined via the ObjRulerType property. Is there a mechanism to extract from an existing iekRuler object the actual length that is displayed on the ruler line without manually defining the ruler rect and calculating the value each time a ruler object is selected?

TIA

John
1   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Apr 19 2012 : 23:02:49
Hello,
the unique way to calculate the ruler length is:

function FixedGetObjDiagLen(ie:TImageEnVect; hobj: integer): double;
var
  lx, ly: double;
  r:TRect;
begin
  ie.GetObjRect(hobj, r);
  lx := abs(r.Right-r.Left) * ie.MeasureCoefX;
  ly := abs(r.Bottom-r.Top) * ie.MeasureCoefY;
  result := sqrt(lx * lx + ly * ly);
end;


It comes from the TImageEnVect.GetObjDiagLen help description.