Quick Setup
- Download the latest dll file from downloads tab
- Copy the dll into your bin folder
- Add the following code just below the page directive
<%@ Register Assembly="CS.Web.UI.CropImage" Namespace="CS.Web.UI" TagPrefix="cs" %>
- Add the following code in your aspx file, make sure you set ImageUrl property of Image control with the existing image url, it can be a file that generate image as a stream.
<asp:Image ID="Image1" runat="server" ImageUrl="images/328.jpg" />
<cs:CropImage ID="wci1" runat="server" Image="Image1" X="10" Y="10" X2="50" Y2="50" />
<asp:Button runat="server" ID="btn" Text="click me" onclick="btn_Click"/>
- Add the following code in .cs file
protected void btnCrop_Click(object sender, EventArgs e)
{
/* thats the method to crop and save the image.*/
wci1.Crop(Server.MapPath("images/sample1.jpg"));
}
Properties;
- X
- Y
- X2
- Y2
- CanvasWidth
- CanvasHeight
- EnablePreview
- PreviewHeight
- PreviewWidth
Events;