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
 iekRuler
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

John

USA
94 Posts

Posted - Apr 17 2012 :  21:30:46  Show Profile  Reply
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

fab

1310 Posts

Posted - Apr 19 2012 :  23:02:49  Show Profile  Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: