ImageEditor load BMP images?

4 posts, 1 answers
  1. Angel
    Angel avatar
    3 posts
    Member since:
    Jul 2012

    Posted 10 Nov 2011 Link to this post

    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
  2. Angel
    Angel avatar
    3 posts
    Member since:
    Jul 2012

    Posted 10 Nov 2011 Link to this post

    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
  3. DevCraft banner
  4. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 11 Nov 2011 Link to this post

    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 >>

  5. Angel
    Angel avatar
    3 posts
    Member since:
    Jul 2012

    Posted 11 Nov 2011 Link to this post

    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
Back to Top