I am trying to convert the BitmapImage into byte array, but not getting the exact solution.
The Image.Save()
method is not available in Silverlight Library.
How to fix this?
Asked
Active
Viewed 1,089 times
0

Jon Egerton
- 40,401
- 11
- 97
- 129

Kapil Kshirsagar
- 282
- 1
- 4
- 19
1 Answers
2
if you image source is in the project you can use this..
var uri = new Uri("/ReferencedAssembly;component/default.png", UriKind.Relative);
var streamInfo = System.Windows.Application.GetResourceStream(uri);
var stream = streamInfo.Stream;
convert the stream to bytes array..
if image is one some other location
Using httpwebrequest to get image from website to byte[]
Regards

Community
- 1
- 1

Shoaib Shaikh
- 4,565
- 1
- 27
- 35
-
The image is from Database which is varbinary(max) type. – Kapil Kshirsagar Jan 02 '12 at 07:39
-
you want to save image to database in byte[]? – Shoaib Shaikh Jan 02 '12 at 07:44
-
and image source is a resource in your application or it is hosted on some other site? – Shoaib Shaikh Jan 02 '12 at 10:50
-
I am implemented the functionality which takes image by drag and drop. User drags and drops the image in grid layout then i have to convert this image into byte[]. This image from user's local resource... – Kapil Kshirsagar Jan 02 '12 at 11:11
-
please clarify what will be the uri of local resource? – Shoaib Shaikh Jan 02 '12 at 11:21