How to programmatically crop image using c#
<p>i have one pdf file which i will save first as image and then crop that image and save as cropped part as new image. i am not getting any idea how to crop the portion which i want.</p>

<p>here is url how our actual image will look like
<a href="https://eshiponline.purolator.com/ShipOnline/shipment/getLabel.ashx?i=Jj9rW5SvclNNj9hf6bPh%2fsvR8ZbXYBG7ZF08%2b5ebYZ%2fgCZwEZpAokaDuO5RTCeLPwAdBUtd%2bCOjtS3WfMkkEKSjvalpxgnM4aQDlpNROUG5OQVSet5Kz4I3HIB76x2wAiOKGCJd1qHtbHL8P8ts%2fm1v4FnZDsF5RV%2fGNJk7TOnI%3d" rel="nofollow">this</a></p>

<p>please click on the link and see what value i should provide to extract left rectangle. can you give me any idea.</p>

<p>i got code to crop a portion of image. here is one sample for cropping programmatically.</p>

<pre><code>Rectangle cropRect = new Rectangle(...);
Bitmap src = Image.FromFile(fileName) as Bitmap;
Bitmap target = new Bitmap(cropRect.Width, cropRect.Height);

using(Graphics g = Graphics.FromImage(target))
{
    g.DrawImage(src, new Rectangle(0, 0, target.Width, target.Height), 
                cropRect,                        
                GraphicsUnit.Pixel);
}
</code></pre>

<p>my concern is what value i should give here to crop the exact left rectangle from the image. <code>Rectangle cropRect = new Rectangle(...);</code></p>

<p>can anyone give me any idea. thanks i got this code from this url
<a href="http://stackoverflow.com/questions/734930/how-to-crop-an-image-using-c">How to crop an image using C#?</a></p>

<p>thanks</p>
