When a RadBitmap is rotated to degrees for which sine and cosine are not integers (every angle which is not 90, 180, 270 or 360) applies wrongly calculated transformations and the bitmap' size is no longer correct. For example, rotating a bitmap to -30 and then to 30 degrees changes its size.
Implement a command that opens a print dialog that allows you to print the image. There could be a print button in the RadImageEditorUI next to the "Save" and "Open" buttons.
When RadBitmap objects which sources are big images (e.g. 2000x1500) are rotate, image quality loss is observed. Internally, RadBitmap.Rotate method is used.
Using the built in OpenImageCommand functionality of telerik:RadImageEditorUI, you can detect the OpenImageCommand has been executed via the CommandExecuted event.
However there is no way to determine whether an image was loaded or not.
The Dialog Result is silently consumed by the OpenImageCommand class so if the user clicks the cancel button on the open file dialogue you have no way of knowing.
It would be good to have a means to determine the dialog result, either via a property on the command, by an additional property in the CommandExecuted event args, or even an event that is raised when an image is loaded or the dialog is cancelled.
To achieve this functionality I had to implement code like the following:
public bool IsNewImage { get; set; }
private void ImageEditor_CommandExecuting(object sender, ImageCommandExecutingEventArgs e)
{
if (e.Command is OpenImageCommand)
{
IsNewImage = false;
}
}
private void HistoryOnCurrentImageChanged(object sender, EventArgs e)
{
var history = (ImageHistory)sender;
IsNewImage = (!history.CanRedo && !history.CanUndo);
}
private void ImageEditor_CommandExecuted(object sender, ImageCommandExecutedEventArgs e)
{
if (e.Command is OpenImageCommand)
{
if (IsNewImage)
{
// Deal with new image...
}
}
}
It'd be so much easier to have the following:
private void ImageEditor_CommandExecuted(object sender, ImageCommandExecutedEventArgs e)
{
if (e.Command is OpenImageCommand)
{
if (!e.CommandCancelled)
{
// Deal with new image...
}
}
}
Thanks 👍
When the ShapeTool is active and you execute another tool (lets say DrawTool) the UI becomes partially unresponsive. This includes the tools section and the tool settings panel. The issue is reproducible in a NoXaml scenario (using implicit styles) and only if the Telerik.Windowls.Controls.ImageEditor.xaml ResourceDictionary is merged in the resources of the view where the control is defined (example: MainWindow.Resources). To work this around define the ResourceDictionary in App.xaml.