Dim resize As New ResizeCommand
Editor.ExecuteCommand(resize, Nothing)
But instead of "Nothing" I need a context object. I assume I should send the desired height and width somehow but what object should I be sending?
5 Answers, 1 is accepted
You will need to pass an instance of the ResizeCommandContext class. You can specify the new width and height of the image in the constructor of the context. Also there is no need to create a new instance of the command itself - you can use the statically create instances in the ImageCommands class.
Here is a code example:
Editor.ExecuteCommand(ImageCommands.Resize,
New
ResizeCommandContext(200, 200))
Greetings,
Alex
the Telerik team
hi,
i try to resize the image after crop command executed and reset.
i put the command on the resetSettings() function of croptool.
public void ResetSettings() { if (this.ReserveWidth > 0 || this.ReserveHeight > 0) { this.imageEditor.ExecuteCommand(ImageCommands.Resize,new ResizeCommandContext(ReserveWidth, ReserveHeight)); } this.cropAdorner.CropRect = new Rect( this.imageEditor.Image.Width * 0.1, this.imageEditor.Image.Height * 0.1, this.imageEditor.Image.Width * 0.8, this.imageEditor.Image.Height * 0.8 ); this.ReserveWidth = 0; this.ReserveHeight = 0; this.cropSettings.Reset(); this.isDirty = false; }
But this throws exceptions.
Could you help me to figure it out?
my propose is that I want to implement a function like Photoshop that ,when you crop an image with desire width and height, you input width and height in the tool settings, then when you drag the crop rectangle, it is always keep the ratio.
for example, you input width 468px and height 250px.
you can drag the crop size to (468*n) X (250*n), but finally you execute the change,
The image will crop to the drag size and scale to reserved size.
We can continue the conversation in the support ticket we opened for you on the same matter.
Kind regards,
Boby
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
i have used another account which is licensed user belongs to company.
i reply your with another ticket.
please connect this issue to that.
I answered the other thread you started and we can continue our communication there.
All the best,
Petya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.