1、提取image control的source
2、从image control中提取图片byte
var himage = (BitmapImage)this.Img.Source;
RandomAccessStreamReference random = RandomAccessStreamReference.CreateFromUri(himage.UriSource);
IRandomAccessStreamWithContentType streamWithContent = await random.OpenReadAsync();
byte[] buffer = new byte[streamWithContent.Size];
await streamWithContent.ReadAsync(buffer.AsBuffer(), (uint)streamWithContent.Size, InputStreamOptions.None);
3、将byte数据转成Image 对象
BitmapImage image = new BitmapImage();
using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream())
{
await stream.WriteAsync(obj.ImgArray.AsBuffer());
stream.Seek(0);
await image.SetSourceAsync(stream);
}