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

michaschumann

Germany
8 Posts

Posted - Aug 12 2020 :  07:09:17  Show Profile  Reply
I just discovered the measurement functions and ask myself wether this is possible:

- A picture of something round/elliptical is taken together with a cm scale (10cm)
- Step 1 the user measures a distance of 10cm on the photo. The measurement should display no label.
- When the measurement 1 is complete I can read the ratio cm/pixels somehow and enable step 2
- Step 2 is a elliptical area measurement. Again I would like to display no label while measuring.
- When the second measurement is complete I display the calculated area and put it into the database.

Is this doable?

Thanks!

Micha Schumann
Marburg, Germany

xequte

38614 Posts

Posted - Aug 12 2020 :  16:55:15  Show Profile  Reply
Hi Micha

Yes, it is very doable. The only difficult part is not displaying a label.

Probably what you'll want to do instead use formatted layers instead of a ruler:

- use miClickCreateLineLayer so user can add a line
- In OnNewLayer format line like like a measure, but without a label
- In OnLayerNotify event, detect end of line addition, get length and then remove line
- use miCreateShapeLayer so user can add an ellipse
- In OnNewLayer format shape layer
- In OnLayerNotify event, detect end of shape addition, get area and then remove shape
- Calculate and add to DB


Also, see these methods in iexLayers.pas. You may want to add them to your code:

function CalcRulerLength(Pt1, Pt2: TDPoint; Units: TIEUnits; DpiX, DpiY: Double): double;
function CalcRulerArea(AreaRect: TRect; Units: TIEUnits; DpiX, DpiY: Double; ZoomX, ZoomY: Double; Ellipse: Boolean = False): double;



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

michaschumann

Germany
8 Posts

Posted - Aug 15 2020 :  07:38:02  Show Profile  Reply
I managed to achieve evetything I wanted using the standard measurement functionality. First I set font size to 1 on measuring the reference length, the label then is nearly invisible.

I detect the end of the measurement in onLayerNotify and set untis to mm and DPI for the IMabgeEnViewer appropriately, then measuring ellipsoid areas is displayed correctly. Great.

Thanks for that great library, I am really looking forward to using all the features. The only thing I am really angry about is that I did not buy a license years ago ;-)

Micha Schumann
Marburg, Germany
Go to Top of Page

xequte

38614 Posts

Posted - Aug 19 2020 :  18:23:14  Show Profile  Reply
Hi Micha

Glad you found a solution. We will look at an easier way to hide the ruler text for a later update.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: