Having trouble setting imgeditcontrol.ImageEditorUI.Image from code

3 posts, 0 answers
  1. Sven
    Sven avatar
    19 posts
    Member since:
    Feb 2011

    Posted 27 Jul 2011 Link to this post

    Hi guys,

    I have an image that I want to load in the ImageEditor, however am getting all sorts of errors. I tried BitmapImage, WritableBitmap, RadBitmap. The first 2 can not be converted. And the RadBitmap gave me something in the effect "Can not convert 1 dimensional...."

    Can you help guide me how would I go about this. I am trying to open the ImageEditor as UserControl inside RadWindow. I am also working in VB.NET

    Thanks
    SD
  2. Sven
    Sven avatar
    19 posts
    Member since:
    Feb 2011

    Posted 28 Jul 2011 Link to this post

    Just to clarify,

    I am using imagetools to decode and encode the image as jpeg and would like to use that stream to display the image in the ImageEditor so I can crop and save it to the DB.

    Hope that makes sense.

    SD
  3. DevCraft banner
  4. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 29 Jul 2011 Link to this post

    Hi Sven,

    There are image format providers that work out of the box and are used to convert between streams and the RadBitmap class. You can find them in the Telerik.Windows.Controls.ImageEditor.FormatProviders namespace and we ship the following:
    • BmpFormatProvider (supporting import and export)
    • JpegFormatProvider (Supporting import only. You can find how to export JPEGs in this blog post)
    • PngFormatProvider (supporting import and export)
    You can always create a WriteableBitmap with the contents of your image, use the RadBitmap(WriteableBitmap source) constructor and assign the instance to the image editor.
    Best wishes,
    Ivailo
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top