
Hi,
I have two questions:
1- is it possible to set the default value of the zoomcontroller to "automatic" instead of 100 %? if possible in XAML, or in code-behind is necessary
2- is there a way (documented or code snippet) so I can filter the export format (i.e.: I only want PNG files)
Thanks
5 Answers, 1 is accepted
To change the zoom of the ZoomController you can set the ScaleFactor property of the corresponding control. Setting the ScaleFactor property to 0 is the same as setting the Auto value in the UI.
imageEditor.ScaleFactor =
0
;
To filter the export format, you can use different approaches depending on your case. Here you can find few which you can try.
- Call, the Save command manually and pass the filter as its CommandParameter.
ImageEditor.Commands.Save.Execute(
"Png Image (.png)|"
);
- Create custom saving without using the image editor save command. You can see this approach demonstrated in the Import/Export help article.
I hope this helps.
Regards,
Martin
Telerik by Progress

Hi Martin
1- Thanks! I understand now my mistake. In my case "imageEditor" was a RadImageEditorUI. Which means that I have to do imageEditor.ImageEditor.ScaleFactor. still it does not work as expected because I want this as default behavior but if ImageEditorUI is instanciated when the screen is opened, ImageEditor property remains null until an image is loaded. I using the default OpenFile command of the component
2- I'll look for the saving command. If I found the SaveCommand attribute, I don't see yet how I can use it and stay full MVVM.I need to search a little longer
There is no default ScaleFactor which you could set. Currently, the approach which you can use is to set the property in code when the ImageEditor is loaded. You can use the ImageEditorLoaded event of the RadImageEditorUI control.
About staying full MVVM while using the SaveCommand, if you are using the save button of the RadImageEditorUI, you can set its SaveCommandParameter property.
<
telerik:RadImageEditorUI
SaveCommandParameter
=
"Png Image (.png)|"
/>
If you are using a custom button defined somewhere outside of the RadImageEditorUI, you can bind it to a new instance of the SaveCommand and set the button's CommandParameter to the RadImageEditor control.
<
Button
Content
=
"Save"
Command
=
"{Binding SaveCommandDefinedInTheViewModel}"
CommandParameter
=
"Png Image (.png)|"
/>
Regards,
Martin
Telerik by Progress

oh..so simple...I didn't think about the CommandParameter. I feel stupid now
Anyway, Martin, a BIG thank you. I'll try it next week but for sure, the two solutions described seem to met perfectly my need. thanks again!

Test confirmed! it works like a charm :)
thx