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

Remove Save and Open open from RadImageEditorUI

17 Answers 119 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Hema
Top achievements
Rank 1
Hema asked on 10 May 2016, 10:35 AM

Hi,

 

I want to modify the RadImageEditorUI controls placement and remove some icons form controls. can you any one tell me how to remove File open and save control ?

 

Regards

Hema

17 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 12 May 2016, 08:34 AM
Hi Hema,

Thank you for your interest in RadImageEditor.

To remove those buttons from the UI, you could set the IsOpenButtonVisible and IsSaveButtonVisible properties of the RadImageEditorUI to false.

I hope this helps.
If you need further assistance, please get back to us again.

Regards,
Todor
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Hema
Top achievements
Rank 1
answered on 12 May 2016, 10:50 AM

Hi Totor,

Thanks for your reply :)

How to call save image functions from image editor in code behind?

 

Regards

Hema

0
Todor
Telerik team
answered on 13 May 2016, 08:53 AM
Hi Hema,

You could invoke the RadImageEditorUI.SaveCommand's Execute() method. More about commands and tools, you could check in this help article. For example:
this.ImageEditorUI.SaveCommand.Execute(null);

I'll be glad to assist your further, if you have further questions.

Regards,
Todor
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Chaithika
Top achievements
Rank 1
answered on 17 May 2016, 07:49 AM

hi,

but how to hide the undo and redo buttons? 

Regards

chaithika

0
Todor
Telerik team
answered on 19 May 2016, 06:44 AM
Hi Chaithika,

Since there isn't an out-of-the-box way to hide the Undo and Redo buttons from the RadImageEditorUI's header, you should edit its template and to remove them from there. 

More about editing styles, you could read in this help article.

Regards,
Todor
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
fff
Top achievements
Rank 1
answered on 01 Jul 2016, 02:56 PM

Hi Todor,

This command is doing a kind of "saveAS" (=asking user for the place & for the extension)

Is there a simple way to just save, without question for better ergonomy speed for user.

It means the same format & location as it was open

 

Thanks in advance for detailed(Teleril beguinner) explanation,

F

0
Todor
Telerik team
answered on 06 Jul 2016, 07:03 AM
Hi Fabrice,

In your scenario, you could use directly the format provider which corresponds to the image's file format instead of using the default SaveImageCommand which has a kind of "Save As" behavior as you already found out. You can check the Import/Export help article for more information on that matter.

I'll be glad to assist you further, if you have more questions.

Regards,
Todor
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Mohammed
Top achievements
Rank 1
answered on 19 Sep 2016, 06:53 AM

Hi Team,

      I am using RadImageEditorUI and RadBarcodeQR in one of my application for WPF without MVVM. I have below concerns please assist me on this how to proceed further.

1) Telerik RadImageEditorUI: 
a. We don’t to show any dialog to provide path where to save, it has to be stored for default path what we provide in code-behind.
b. Pass System.Windows.Controls.Image to RadImageEditorUI as a Parameter from one Window to another Window.
2) Telerik QRCode printing under YMC (Yellow, Magenta and Cyan) and it is printing as color it should print on K (Black) panel without any color.

Waiting for your Quick response.

Thanks for your Cooperation and Support in advance

Regards

Mohammed Suhail

0
Tanya
Telerik team
answered on 21 Sep 2016, 11:42 AM
Hello Mohammed,

I'll go straight to your questions:

1) RadImageEditorUI:
a. You could use the import/export functionality of the RadImageEditor as I've suggested in the previous post. To remove the save button from the UI, you could set the IsSaveButtonVisible property of the RadImageEditorUI to false.
b. About passing data between your ViewModels, you could check the following articles: 2) RadBarcodeQR
If I have correctly understood your question, you want to change the colors of the RadBarcodeQR control. Basically, the RadBarCodeQR code is a little different when it comes to the styling of colors. Internally, it utilizes a WritableBitmap to render the control. Thus, the color setting is ignored. This is a bug and it is already logged in our Feedback Portal where you can track its progress and vote for its implementation. 

Regards,
Tanya
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Mohammed
Top achievements
Rank 1
answered on 23 Sep 2016, 06:40 AM

Hi Tanya,

Thanks for the mail and information provided for my concerns.

I have referred the import/export functionality of RadImageEditor UI in that exporting of Image is happening through SaveDialog. I dont want to Show any Dialog for Saving Image to folder it should save in local path I have mention in code behind.

I have made IsSaveButtonVisible to false and i have taken one Button and implemented Export Functionality in that click event it is saving the image as it is. I need to save the modified Image with Crop, Resize, Brightness and etc.. into local folder without SaveDialog.

Thanks for your Support in advance.

Regards

Mohammed Suhail

0
Nikolay Demirev
Telerik team
answered on 27 Sep 2016, 12:45 PM
Hi Mohammed,

If I have understand you correctly you have implemented the export in your own button, but it still uses SaveFileDialog and you want to specify the file path in your code.

You can achieve this by opening the file stream not using the dialog, but the following code snippet instead:
using(Stream stream = File.OpenWrite("path to the file"))
{
     provider.Export(image, stream);
}

I hope this helps.
 
Regards,
Nikolay Demirev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Mohammed
Top achievements
Rank 1
answered on 28 Sep 2016, 07:04 AM

Hi Nikolay Demirev,

    Thanks for your reply. I have used the code snippet what you have sent and implemented in my application. It is saving the original image without any modified changes like Crop, Brightness, Contrast, Resize etc.., applied for RadImageEditorUI Image, I want to save the modified image with the code snippet what you have provided.

I am using the below code to Load image on RadImageEditor

 private void AddImageInEditor(string ImagePath)
        {
                Stream stream = new FileStream(ImagePath, FileMode.Open, FileAccess.Read);
                IImageFormatProvider formatProvider = ImageFormatProviderManager.GetFormatProviderByExtension(".png");
                this.ImageEditorUI.Image = formatProvider.Import(stream);

       }

I am using Below code what you have sent to Save in local path

private void ExportImage()
        {
            IImageFormatProvider formatProvider = ImageFormatProviderManager.GetFormatProviderByExtension(".png");
            using (Stream stream = File.OpenWrite(System.Windows.Forms.Application.StartupPath + "\\Images\\Captured11.png"))
            {
                formatProvider.Export(this.ImageEditorUI.Image, stream);
            }
        }

Thanks for your Support in Advance.

Regards

Mohammed Suhail

0
Nikolay Demirev
Telerik team
answered on 30 Sep 2016, 11:19 AM
Hello,

You might have to commit the changes to the tool you use. In the last example on this help article will help you do that.

Regards,
Nikolay Demirev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Rob A.
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 02 Dec 2020, 08:36 PM

I'd like to hide the Redo/Undo buttons also ... your solution seems to indicate that I'm out of luck given I'm using XAML and StyleManager ... or is there any easier method not that it's 4 years later?

Cheers, Rob.

0
Martin Ivanov
Telerik team
answered on 07 Dec 2020, 10:00 AM

Hello Rob,

There is no API that allows hiding the undo and redo buttons. To do this, you can extract the ControlTemplate of RadImageEditorUI and hide/remove the buttons from there. Then re-apply the customized template via the Template property of RadImageEditorUI. For example:

<!-- additional resources required by the original template here -->

<ControlTemplate x:Key="ImageEditorUICustomTemplate" TargetType="telerik:RadImageEditorUI">
	<!-- modified Xaml here -->
</ControlTemplate>

<telerik:RadImageEditorUI Template="{StaticResource ImageEditorUICustomTemplate}" />

Note that even when using Xaml dlls and StyleManager, you can still use this approach. The only difference between the Xaml and NoXaml is that in the Xaml case you will need to contain more resources in your project compared to NoXaml where you can reference them from the Telerik resource files using the StaticResource keyword. 

If you do not want to keep a custom style on your side, you can use an approach with code-behind. Basically, you can subscribe to the Loaded event of RadImageEditorUI and use the ChildrenOfType<T>() method to get the undo and redo buttons. Then set their Visibility to Collapsed.

private void RadImageEditorUI_Loaded(object sender, RoutedEventArgs e)
{
	var imageEditorUI = (RadImageEditorUI)sender;
	var buttons = imageEditorUI.ChildrenOfType<RadButton>();
	var undoButton = buttons.FirstOrDefault(b => b.Command == ImageEditorCommands.UndoCommand);
	var redoButton = buttons.FirstOrDefault(b => b.Command == ImageEditorCommands.RedoCommand);
	undoButton.Visibily = Visibility.Collapsed;
	redoButton.Visibily = Visibility.Collapsed;
}

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Rob A.
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 09 Dec 2020, 07:17 PM

Hi Martin,

Thanks for the code snippet ... I think you mean "Visibility" rather than "Visibily".  Unfortunately even with that code adjustment I'm getting an error that indicates "ImageEditorCommands.UndoCommand" and "ImageEditorCommands.RedoCommand" is a class type and cannot be used as an expression.  (I did Imports Telerik.Windows.Media.Imaging).

Thoughts?

Cheers, Rob.

0
Martin Ivanov
Telerik team
answered on 09 Dec 2020, 10:34 PM

Hello Robin,

It looks like I have two errors in the my snippet. Please excuse me for this. Indeed, the property is Visibility and also the Undo/RedoCommand are not static properties. To access them, you can use the Commands property of the RadImageEditor control. 

Here is the updated code snippet:

var buttons = imageEditorUI.ChildrenOfType<RadButton>();
var undoButton = buttons.FirstOrDefault(b => b.Command == imageEditorUI.ImageEditor.Commands.Undo);
var redoButton = buttons.FirstOrDefault(b => b.Command == imageEditorUI.ImageEditor.Commands.Redo);
undoButton.Visibility = Visibility.Collapsed;
redoButton.Visibility = Visibility.Collapsed;

Note that in order to get a value from the ImageEditor property of the RadImageEditorUI you will need to wait for the internal RadImageEditor to get loaded. You can indicate this using the ImageEditorLoaded event of RadImageEditorUI.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
ImageEditor
Asked by
Hema
Top achievements
Rank 1
Answers by
Todor
Telerik team
Hema
Top achievements
Rank 1
Chaithika
Top achievements
Rank 1
fff
Top achievements
Rank 1
Mohammed
Top achievements
Rank 1
Tanya
Telerik team
Nikolay Demirev
Telerik team
Rob A.
Top achievements
Rank 2
Iron
Iron
Veteran
Martin Ivanov
Telerik team
Share this question
or