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

Importing stream into editor

3 Answers 111 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 23 Jul 2015, 03:33 PM

Hi,

 I'm using the latest version of Telerik and I created a UserControl which contain a RadImageEditorUI. My UserControl contain a property named "Image" of type "Stream" and I would like to know how I can display it in the editor and I would like to know also how I can take the image in the editor and transform it as a stream?

 

Thank's

Alain

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 27 Jul 2015, 08:51 AM
Hi Alain,

In order to display an image in the control, you could import the stream into the RadImageEditor using the appropriate format provider. More information about how to achieve this you can find in the Import/Export article. The image from the control could be exported directly to a file or to a byte[] using the different overloads of the Export() method of the corresponding format provider.

I hope this helps.

Regards,
Tanya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Christie Admin
Top achievements
Rank 1
answered on 14 Aug 2015, 05:11 PM

Ho Tanya,

 

actually, our application save/load an image into our database as a stream so can you provide me an example on how I can assign a stream to the editor and convert the editor image to a stream?!?

 

Thank's

Alain

0
Todor
Telerik team
answered on 19 Aug 2015, 08:06 AM
Hi Alain,

As Tanya suggested, you could use the RadImageEditor's format providers in order to import/export images. If you have exported the image to byte[], you could check this article on StackOverflow about converting byte array to a stream. In addition, you could use the format provider's overload of the Export() method which gets as a parameter a stream object in which the image shall be written.

For your convenience, I've created a sample demo project which uses the second mentioned approach. You can find it attached.

I hope this helps.

Regards,
Todor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ImageEditor
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Christie Admin
Top achievements
Rank 1
Todor
Telerik team
Share this question
or