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

Image convertion to Byte

4 Answers 52 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
veera
Top achievements
Rank 1
veera asked on 05 Oct 2009, 10:41 AM
How do I convert the Image control imge to Byte array in silverlight 3.0?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 05 Oct 2009, 08:00 PM
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.
0
veera
Top achievements
Rank 1
answered on 06 Oct 2009, 05:26 AM
Hi Hristo

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

Let me know how to use this.

Thanks.
0
Hristo Borisov
Telerik team
answered on 06 Oct 2009, 01:35 PM
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.
0
veera
Top achievements
Rank 1
answered on 07 Oct 2009, 07:16 AM
Hi Hristo

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

Please let me know.

Thanks.
Tags
General Discussions
Asked by
veera
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
veera
Top achievements
Rank 1
Share this question
or