0

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?

Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
Kapil Kshirsagar
  • 282
  • 1
  • 4
  • 19

1 Answers1

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