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

ImageEditor load BMP images?

3 Answers 70 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Angel
Top achievements
Rank 1
Angel asked on 10 Nov 2011, 05:11 PM
Hello,

The documentation says ImageEditorUI supports loading/saving BMP images. In the online demo of the image editor, it only supports opening PNG and JPEG images - the filter in the Open File dialog is set to only PNG/JPEG. It seems the default OpenImageCommand does not allow opening BMP images.

Is there a way to customize the existing OpenImageCommand to allow loading BMPs, without having to write my own custom OpenImageCommand?

Thanks,

Angel

3 Answers, 1 is accepted

Sort by
0
Angel
Top achievements
Rank 1
answered on 10 Nov 2011, 05:31 PM
To clarify - it looks like the online demo ImageEditor includes .BMP files when the All Images filter is selected in the Open File dialog, however the ImageEditor in my app does not include .BMP files when All Images is selected. This also happens in the sample app from this blog: http://blogs.telerik.com/blogs/posts/11-07-20/under-the-hood-of-radimageeditor-for-silverlight-and-wpf.aspx where a custom format provider is defined.

Thanks,

Angel
0
Accepted
Iva Toteva
Telerik team
answered on 11 Nov 2011, 10:59 AM
Hi Angel,

RadImageEditor can open BMP images from its first release. The difference comes from the filter that the OpenFileDialog of OpenImageCommand uses in the different version.

In the official Q2 release (2011.2.712), which is the version that the CustomFormatProvider demo uses, the filter the BMP extension has been accidentally omitted, but BMP images could still be opened if you type their name in the File name text box. In addition, there was a typo in the way the "All images" part of the filter was set
In Q2 SP1 (2011.2.920) - the version used in this online demo - the BMP filter was still missing, but the typo in the All images filter was fixed and therefore, you are able to select images in this format.
In the internal builds after 2011.2.920 and the Q3 Beta, we have changed the logic in order to include all registered format providers (including BMP and custom ones that may be defined). You can see how it works in the Q3 Beta demo.

With all versions, you can implement your version of the command (using the correct filter). The custom command approach has been described here. The solution there is for the SaveCommand, but the walk through is the same for the OpenImageCommand.

All the best,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Angel
Top achievements
Rank 1
answered on 11 Nov 2011, 02:59 PM
Thanks Iva,

I implemented a custom OpenImageCommand with the following filter:

"BMP Images (*.bmp)|*.bmp|PNG Images (*.png)|*.png|JPEG Images (*.jpg,*.jpeg)|*.jpg;*.jpeg|All Images|*.bmp;*.png;*.jpg;*.jpeg"


Regards,

Angel
Tags
ImageEditor
Asked by
Angel
Top achievements
Rank 1
Answers by
Angel
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or