I have an Image which I want to crop. I already know that my required content is in the lower part of the image so how can I automatically crop it using Rectangle ?
I tried to use this Code (Below) to crop but it didn't help. I haven't used Rectangle much so please guide me.
private Bitmap cropImage(Bitmap img)
{
int height= img.Height / 2;
Rectangle CropArea = new Rectangle(100,height, 1400, 900);
Bitmap bmpCrop = img.Clone(CropArea, img.PixelFormat);
return bmpCrop;
}
the cropped image turned out fine but it's hardcoded. I need to make it dynamic so it gives same result for different images