RadImageEditor provides a tool that enables the user to remove outer parts of an image to improve framing on the image (bring the focus to the subject), give an accent to a subject from the image or change the aspect ratio. This example demonstrates how to enable and use the Crop tool. Basically, an ImageEditorTool, with CommandName="Crop", needs to be created for the Crop tool to be rendered on the control's ToolBar.
How the Crop dialog works:
The dimensions of the crop rectangle (and the resulting image) are always retrieved from the Width and Height text-boxes, and the image is actually cropped when the Crop button is clicked.
The Aspect Ratio DropDownList contains a list of preset sizes for the crop box. Upon selection, the values in the Width and Height inputs are changed. And the movable crop box automatically reflects the selection.
- The X and Y text-boxes specify the Left, Top position where the crop-box will be placed, relatively to the Top-Left corner of the image.
There are two buttons that control the relationship between the Width and Height text-boxes: Constrain proportions and Swap dimensions. The first is used to lock the ratio between the width and height and keep the aspect ratio. By default the aspect ratio is preserved.
The second gives the possibility to easily exchange the values of the width and height.