This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, December 25, 2013 10:22:06 PM(UTC)
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 ?
#2
Posted
:
Thursday, December 26, 2013 3:33:44 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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.