The following is the code:
- Code: Select all
// create filter
var toCrop = new System.Drawing.Rectangle((int)firstP.X, (int)firstP.Y, (int)(firstP.X-secondP.X), (int)(firstP.Y - secondP.Y));
var imgSize = new System.Drawing.Rectangle(0, 0, toRead.Width, toRead.Height);
Crop filter = new Crop(toCrop);
// apply the filter
System.Drawing.Image clonedImg = new Bitmap(toRead.Width, toRead.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
clonedImg = (System.Drawing.Image)toRead.Clone(imgSize, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
var bmp8bpp = Grayscale.CommonAlgorithms.BT709.Apply((Bitmap)clonedImg);
Bitmap newImage = filter.Apply((Bitmap)bmp8bpp.Clone());
The following is the error detials:
If you need anymore information just ask.
Thanks,
Nathan