This is a migrated thread and some comments may be shown as answers.
Convert image to byte array and bind to image editor.
4 Answers 90 Views
This is a migrated thread and some comments may be shown as answers.
Damian
Top achievements
Rank 1
Damian asked on 11 Jul 2013, 09:12 AM
Hi

There is a radimageeditor in my page and I am uploading images. The uploaded image I am converting to a byte array and I want to bind it to the editor. I tried a lot but got stuck with this. Somebody please help to get this working. Any code will be a a great help for me.

Thankyou for all replies
Damian

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 11 Jul 2013, 10:08 AM
Hi Damian,

In order to achieve the required result you can assign custom content provider to RadImageEditor and work with images stored in database. Please take a look at this live demo utilizing such content provider.

Thanks,
Shinu.
0
Shinu
Top achievements
Rank 1
answered on 12 Jul 2013, 10:34 AM
Hi Damian

Check the following demo which explains exactly what you want
ImageEditor - Upload and Edit Image

Hope this helps

Thanks
Shinu
0
Arron
Top achievements
Rank 1
answered on 12 Dec 2013, 03:42 AM
I have never tried radimageeditor before. But I am testing with the related image converting projects these days. I am almost a green hand on image editing. I hope you success. Good luck.



Best regards,
Arron
0
saw
Top achievements
Rank 1
answered on 24 Jul 2014, 05:42 AM
First of all this is my approach to solve this prob,
1) My "telerik:RadImageEditorUI ",
<telerik:RadImageEditorUI x:Name="imageEditor" Grid.Column="3" Margin="10,10,10,326" ImageEditorLoaded="imageEditor_ImageEditorLoaded"></telerik:RadImageEditorUI>
 
2) In my View backend at " imageEditor_ImageEditorLoaded" event is creating another event to identify ImageEditor, image change event.
3) In " imageEditor_ImageEditorLoaded" event use to convert byte[] to ImageEditor Image.
4) In "History_CurrentImageChanged" event use to convert ImageEditor Image to byte[].
Every time i used "PngFormatProvider" for converting.
private void imageEditor_ImageEditorLoaded(object sender, EventArgs e)
       {
           //History.CurrentImageChanged event creating
           this.imageEditor.ImageEditor.History.CurrentImageChanged += new EventHandler(History_CurrentImageChanged);
 
           //Initial image loading into ImageEditor
           if (ImagesourcebyteArray != null)
           {
               PngFormatProvider png = new PngFormatProvider();                
               this.imageEditor.ImageEditor.Image = png.Import(ImagesourcebyteArray );               
           }
       }
******************************
void History_CurrentImageChanged(object sender, EventArgs e)
        {           
            ImageHistory history = (ImageHistory)sender;
            if (!history.CanRedo && !history.CanUndo)
            {
                PngFormatProvider png = new PngFormatProvider();               
               ImagesourcebyteArray = png.Export(this.imageEditor.ImageEditor.Image);
                 
            }
            else
            {
                
            }
        }

Asked by
Damian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Arron
Top achievements
Rank 1
saw
Top achievements
Rank 1
Share this question
or