Windows 8 : display an image stored in the sharing data.

, , Comments Off on Windows 8 : display an image stored in the sharing data.

Just a quick snippet to remember it someday 🙂 !

It gets the bytes of a screenshot from a sharing operation and display it in an image control named “image”.
[csharp]var bitmapStream = args.ShareOperation.Data.GetBitmap();
if (bitmapStream.Size <= 0) return;
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(bitmapStream);
image.Source = bitmapImage;
[/csharp]

Regards