Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, December 25, 2013 10:27:06 PM(UTC)
Daidaiyu

Groups: Registered
Posts: 9


Hello ~
When I get the total number of pixels in the image region by the function RasterImage.CalculateRegionArea() , how to convert it to square centimeter or square milimeter , which function can I invoke ?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, December 26, 2013 3:38:44 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 post(s)

Daidaiyu,
You can do that using code similar to the below:
+-----------------------------+
int TotalPixels = RasterImage.CalculateRegionArea();
double AreaInSquareInches = TotalPixels * 1.0 / RasterImage.XResolution / RasterImage.YResolution;
const double SquareCmPerSquareInch = 2.54 * 2.54;
double AreaInSquareCentimeter = AreaInSquareInches * SquareCmPerSquareInch;
double AreaInSquareMillimeters = AreaInSquareCentimeter * 100;
+-----------------------------+

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.095 seconds.