Image convertion to Byte

5 posts, 0 answers
  1. veera
    veera avatar
    6 posts
    Member since:
    May 2009

    Posted 05 Oct 2009 Link to this post

    How do I convert the Image control imge to Byte array in silverlight 3.0?

    Thanks.
  2. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 05 Oct 2009 Link to this post

    Hello Veera,

    First of all you should use BitmapImage to store your data and then you should use the CopyPixels method of the BitmapImage class to get access to the bytes itself. Here is a more comprehensive explanation of the CopyPixels method. I hope this will resolve your issue.

    Greetings,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. veera
    veera avatar
    6 posts
    Member since:
    May 2009

    Posted 06 Oct 2009 Link to this post

    Hi Hristo

    I dont find any way to use the CopyPixels method in silverlight 3.0.

    Let me know how to use this.

    Thanks.
  4. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 06 Oct 2009 Link to this post

    Hello Veera,

    I didn't see that you were asking about Silverlight. Excuse me. In Silverlight 3 you have the WriteableBitmap class that gives you ability to edit pixels on the fly. Unfortunately, Microsoft has not yet resolved the security issue of editing pixels of an existing image, and thus you are only able to take a snapshot of a control or input the pixels yourself. Rick Barraza has two very interesting topics explaining the use of WriteableBitmap here and here that may be useful in your case. If you share your reasons why you want to edit the pixels of an existing image, maybe we can propose to you a workaround based on our experience. Thank you for contacting us and we look forward to hearing again from you.

    Regards,
    Hristo Borisov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. veera
    veera avatar
    6 posts
    Member since:
    May 2009

    Posted 07 Oct 2009 Link to this post

    Hi Hristo

    I want to store the image control images to sql database with bytes.

    Please let me know.

    Thanks.
Back to Top