What i need to do is just crop following image
and display only the mail item instead of with that mail picture .
I have used the following code but it just crop the right side not left .
Note: Picture is just an example get it from google image
Bitmap croppedBitmap = new Bitmap("E:/my234.png");
try
{
croppedBitmap = croppedBitmap.Clone(new Rectangle(0,0,202, 17), System.Drawing.Imaging.PixelFormat.DontCare);
pictureBox1.Image = croppedBitmap;
}
catch(Exception ex)
{ string se = ex.ToString(); }
Click the picture. Click Picture Tools > Format, and in the Size group, click the arrow under Crop. From the menu that appears, select Aspect Ratio, then click the ratio that you want. A crop rectangle appears, showing you how the picture will appear when cropped to the selected aspect ratio.
Right mouse click on the selection and choose Crop. Right mouse click on the image and choose Resize. Click on Pixels. Enter horizontal or vertical size (the other side will self adjust) • Save and name.
Have you read MSDN?
It's clearly stated that:
rect
Type: System.Drawing.Rectangle
Defines the portion of this Bitmap to copy. Coordinates are relative to this Bitmap.
All you need are proper coordinates:
Rectangle(20, 0, 182, 17)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With