drupal hit counter
Jerry Huang | Translation between WP and Win8 Metro series: loading byte array into BitmapImage

Jerry Huang apps and developing apps

Translation between WP and Win8 Metro series: loading byte array into BitmapImage

1. November 2012 14:07 by Jerry in C#, Win8 Development, Windows Phone Development

WP

Code
1
2
3
 byte[] frameBuffer;BitmapImage.SetSource(new MemoryStream(frameBuffer, 0, frameBuffer.Length));

Win8

Code
1
2
3
4
5
  var ms = new Windows.Storage.Streams.InMemoryRandomAccessStream();ms.AsStreamForWrite().Write(frameBuffer, 0, frameBuffer.Length);ms.Seek(0);BitmapImage.SetSource(ms);

it looks to me that Win8 just making thing complicated:(