cropping a image
<p>I have a requirement where an image is cropped and saved in the DB.
When the user uploads his/her photo, first a large size image is made of this original image. 
Then the large image is cropped and saved as a thumb image.
So there are 3 sizes: original, large(which needs to be cropped by the user), thumb image.</p>

<p>So I found a control on the internet which does this cropping. 
<a href="http://webcropimage.codeplex.com/releases/view" rel="nofollow">http://webcropimage.codeplex.com/releases/view</a>
This is the code used to make a large image of the origina</p>

<pre><code>public static byte[] MakeThumb(byte[] fullsize, int maxwidth)
    {
        Image iOriginal, iThumb;
        double scale;

        iOriginal = Image.FromStream(new MemoryStream(fullsize));
        if (iOriginal.Width &gt; maxwidth)
        {
            scale = iOriginal.Width / maxwidth;
            int newheight = Convert.ToInt32(iOriginal.Height / scale);
            iThumb = new Bitmap(iOriginal, maxwidth, newheight);
            MemoryStream m = new MemoryStream();
            iThumb.Save(m, System.Drawing.Imaging.ImageFormat.Jpeg);
            return m.GetBuffer();
        }
        else
        {
            return fullsize;
        }
    }
</code></pre>

<p>Once a large image is generated, it needs to be cropped. Here's the code/dll I am using to crop the image</p>

<pre><code>&lt;asp:Button ID="btnCrop" runat="server" Text="Crop" onclick="btnCrop_Click" /&gt;

 &lt;cs:CropImage ID="wci1" runat="server" 
            Image="Image1"            
            MinSize="100,100"
            MaxSize="150,150"
            W="150"
            H="150"
             /&gt;      

protected void btnCrop_Click(object sender, EventArgs e)
    {

        /* thats the method to crop and save the image.*/
        wci1.Crop(Server.MapPath("images/cropped.jpg"));

        /*
         this part is just to show the image after its been cropped and saved! so focus on just the code above.
         */
        Image img = new Image();
        img.ImageUrl = "images/cropped.jpg?rnd=" + (new Random()).Next(); // added random for caching issue.
        this.Controls.Add(img);
    }
</code></pre>

<p>wci1.Crop(Server.MapPath("images/cropped.jpg")) takes images/cropped.jpg as its parameter. 
How should I alter the code so that it takes a large image instead of "images/cropped.jpg"
I mean something like this:  wci1.Crop(Server.MapPath(largeimage). </p>

<p>Thank you in advance
Sun</p>
