Crop left side of image

yasmuru picture yasmuru · Aug 26, 2013 · Viewed 10.5k times · Source

What i need to do is just crop following image

enter image description here

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(); }

Answer

Na Na picture Na Na · Aug 28, 2013

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)