Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to make a scanning application and trying to crop only image from A4 document. That application will scan the document and will display image in a picture box. The problem I am facing is image (Documents image which kept in the scanner or say ‘real ’image) .please let me is there any solution in available in c#.I have tried cropping with a fixed size and it is working.But in our case customer can place anywhere in the printer and scan the image.Only thing is we have to crop exactly the image from scanned document.


Image img = Image.FromFile("D:\\pancardError.jpg");
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(new Rectangle(100, 100, 300, 300), bmpImage.
PixelFormat);

Guid gi = new Guid();

bmpCrop.Save( "D:\\hellocrop" + gi + ".jpg");
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900