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
 Convert size and position from pixels to millimeters (IEvolution .NET 8.0.0.0)
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Deeron

34 Posts

Posted - Nov 13 2021 :  06:18:04  Show Profile  Reply
Hi Nigel,

Is it possible to convert the size and position from pixel to millimetre for the background image and layer?

What I mean by this is that when I load a background image, I want to get its size in millimeters instead of pixels, and when I place one or more layers on top of it, I want to get the size and position of the layers relative to the background image also in millimeters instead of pixels. Sorry if my question is a bit confusing. But I saw in the IEvolution .NET help that you can switch between ruler units (IEViewRulerParams.IERulerUnits), so I'm asking if there is a built-in conversion option for this. I couldn't find one in the IEVolution help. :(

Thanks for the help.
Regards,
Deeron

xequte

6513 Posts

Posted - Nov 14 2021 :  17:17:01  Show Profile  Reply
Hi Deeron

There is not a method for this, but the math is pretty straightforward:

// Convert pixels to inches
in = px / DPI;

// Convert pixels to mm
mm = px / DPI * 25.4;




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

xequte

6513 Posts

Posted - Nov 14 2021 :  17:23:09  Show Profile  Reply
Here are the DPI values:

https://www.imageen.com/ievolutionhelp/html/7d9264ad-bcc0-4169-9e5c-44c2da7b40b9.htm
https://www.imageen.com/ievolutionhelp/html/f4db3523-f3a0-be67-e788-4315b54de541.htm

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

Deeron

34 Posts

Posted - Nov 15 2021 :  01:31:57  Show Profile  Reply
Thanks for the answer, Nigel.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: