using System;
public class AreaOfRectangle
{
public static void Main()
{
int Length = 15;
int Breadth = 6;
int Area = Length * Breadth;
Console.WriteLine($"Area of Length {Length} and Breadth {Breadth} Rectangle is {Area}");
Console.ReadKey();
}
}
I assume you want to calculate area of rectangle using c#.
Please see the below code.
using System;
public class AreaOfRectangle
{
public static void Main()
{
int Length = 15;
int Breadth = 6;
int Area = Length * Breadth;
Console.WriteLine($"Area of Length {Length} and Breadth {Breadth} Rectangle is {Area}");
Console.ReadKey();
}
}
You can use LEADTOOLS Imaging Pro SDK technology in your application.
https://www.leadtools.com/sdk/products/imaging-pro
You can use GetAreaInPixels method inside the AnnRectangleObject class. This method is used to return the area bounded inside an AnnRectangleObject in pixels.
Here is some code:
// Load the image
using (RasterCodecs _codecs = new RasterCodecs())
using (RasterImage _image = _codecs.Load(@"FILE PATH TO SOURCE IMAGE"))
{
// Create the annotation container to store the annotation objects
AnnContainer _container = new AnnContainer();
_container.Mapper.MapResolutions(_image.XResolution, _image.YResolution, _image.XResolution, _image.YResolution);
_container.Size = _container.Mapper.SizeToContainerCoordinates(_image.ImageSize.ToLeadSizeD());
// Annotation unit is 1/720 of an inch
double inch = 720.0;
// Add 1st rectangle as annotation
AnnRectangleObject _annRect = new AnnRectangleObject();
_annRect.Rect = new LeadRectD(1 * inch, 2 * inch, 1 * inch, 3 * inch);
_annRect.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Green"), LeadLengthD.Create(1));
_container.Children.Add(_annRect);
// Get the area of the rectangle
double rectArea = _annRect.GetAreaInPixels(_container.Mapper);
}
Abhishek YadavPosted Oct 19, 2022, 10:46 AM
Brahma Prakash ShuklaPosted Oct 18, 2022, 6:26 PM
I assume you want to calculate area of rectangle using c#.
Please see the below code.
Kip HackmanPosted Oct 18, 2022, 4:46 PM
You can use LEADTOOLS Imaging Pro SDK technology in your application.
https://www.leadtools.com/sdk/products/imaging-pro
You can use GetAreaInPixels method inside the AnnRectangleObject class. This method is used to return the area bounded inside an AnnRectangleObject in pixels.
Here is some code:
Md SarfarajPosted Jul 6, 2022, 4:17 AM
Amit MohantyPosted Jul 5, 2022, 1:02 PM