Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
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.