This is a migrated thread and some comments may be shown as answers.

Crop Static Height Width

1 Answer 83 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
mehmet
Top achievements
Rank 1
mehmet asked on 10 Jun 2014, 02:20 PM
Hello everyone ,
I have used a RadImageEditorButton as

 <telerik:RadImageEditorButton Grid.Column="2" Image="/Telerik.Windows.Controls.ImageEditor;Component/Images/Default/Crop.png"  
                                                  x:Name="btnCrop" Command="{Binding Path=Commands.ExecuteTool, ElementName=imageEditor}">
                            <telerik:RadButton.CommandParameter>
                                <tools:CropTool/>
                            </telerik:RadButton.CommandParameter>
                        </telerik:RadImageEditorButton>

I want to crop only assigned width and height like 320 x 220 and unresizeable.

Thanks in advance..

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 13 Jun 2014, 11:53 AM
Hi Mehmet,

Thank you for contacting us.

In case you want to execute the CropCommand with predefined start point, width and height values, you can use the following code snippet, placed in appropriate place into your code:
CropCommandContext context = new CropCommandContext(100, 100, 320, 220);
this.ImageEditorUI.ImageEditor.ExecuteCommand(new CropCommand(), context);
Note that "ImageEditorUI" is the name of the RadImageEditorUI control which is used in the application. The code above will crop the image to an image with width '320' and height '220', starting from the point with coordinates (100,100) calculated from the image's top left corner.

In case you want to make a custom tool, with different UI, you can go to our SDK Browser and see the CustomWatermarkTool demo or go directly to our GitHub repository, download and run the demo.

If you have further questions, please get back to us.

Regards,
Todor
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ImageEditor
Asked by
mehmet
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or