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
 Scale and ruler
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Janex

Latvia
3 Posts

Posted - Nov 14 2014 :  00:17:44  Show Profile  Reply
Hi all.
I have picture with some very small objects, viruses, for example.
I know picture scale, 1:100000 for example.
Is there some way to programmatic set ruler to display
real size of measured object ?

WBR
Janex

xequte

39142 Posts

Posted - Nov 15 2014 :  20:10:36  Show Profile  Reply
Hi Janex

Do you mean a ruler along the top/side of the image, or a ruler that the user can select the start and end of the object.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Nov 16 2014 :  12:18:46  Show Profile  Reply
For objects see:
ScaleFactor, SetScaleFromPixels and SetScaleFromSelectionLen

Declaration
property ScaleFactor: double;

Description
ScaleFactor specifies the scale factor (default 1).

In the common representation X:Y (ex. 1:100000) is the Y value (100000).
This value, with DpiX and DpiY (and measure unit MUnit), weight the measurements of areas and line lengths.

Example
// Sets a scale factor of 1:100000
ImageEnVect1.ScaleFactor:=100000;


Declaration
procedure SetScaleFromPixels(px:integer; mm:double);

Description
SetScaleFromPixels changes the ScaleFactor property such that px pixels correspond to one mm (MUnit).

Example
// This code makes so that 100 pixels are equals to 1 meter.
ImageEnVect1.MUnit:=ieuMETERS;
ImageEnVect1.SetScaleFromPixels(100,1);


Declaration
procedure SetScaleFromSelectionLen(mm:double);

Description
SetScaleFromSelectionLen makes the perimeter of the selection region correspond to one mm (MUnit) by changing ScaleFactor property.

Example
// This computes scalefactor so that the length of the current selection measures 5 millimeters.
TImageEnVect1.MUnit := ieuMILLIMETERS;
TImageEnVect1.SetScaleFromSelectionLen(5);

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: