先将BitmapImage转化为WriteableBitmap,然后得到base64字符串,然后可以得到base64的byte[]数组,再然后您可以把byte[]变成Stream
1 byte[] b = ...//这里的b为上面生成的base64编码的byte数组
2 MemoryStream ms = new MemoryStream(b);
3 BitmapImage bitImage = new BitmapImage();
4 bitImage.SetSource(ms);
5 img2.Source = bitImage;