Importing stream into editor

4 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 23 Jul 2015 Link to this post

    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

  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 27 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 14 Aug 2015 Link to this post

    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

  5. Todor
    Admin
    Todor avatar
    168 posts

    Posted 19 Aug 2015 Link to this post

    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
Back to Top