This is a migrated thread and some comments may be shown as answers.
Having trouble setting imgeditcontrol.ImageEditorUI.Image from code
2 Answers 101 Views
This is a migrated thread and some comments may be shown as answers.
Sven
Top achievements
Rank 1
Sven asked on 27 Jul 2011, 03:34 PM
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 Answers, 1 is accepted

Sort by
0
Sven
Top achievements
Rank 1
answered on 28 Jul 2011, 08:49 PM
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
0
Ivailo Karamanolev
Telerik team
answered on 29 Jul 2011, 09:09 AM
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!

Asked by
Sven
Top achievements
Rank 1
Answers by
Sven
Top achievements
Rank 1
Ivailo Karamanolev
Telerik team
Share this question
or