Convert image to byte array and bind to image editor.

5 posts, 0 answers
  1. Damian
    Damian avatar
    21 posts
    Member since:
    Mar 2013

    Posted 11 Jul 2013 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2013 Link to this post

    Hi Damian

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

    Hope this helps

    Thanks
    Shinu
  5. Arron
    Arron avatar
    22 posts
    Member since:
    Apr 2013

    Posted 11 Dec 2013 Link to this post

    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
  6. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 24 Jul 2014 Link to this post

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

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017