How save BitmapImage WinRT

前端 未结 5 901
攒了一身酷
攒了一身酷 2020-12-21 06:20

I have BitmapImage:

BitmapImage image = new BitmapImage();
image.SetSource(memStream);

I want to save the image to the disk to see in the f

5条回答
  •  余生分开走
    2020-12-21 07:03

    You can't save or modify a BitmapImage. You need to use a WriteableBitmap instead. If you really have no choice but start with a BitmapImage - check its UriSource property to either download the same image again or load a WriteableBitmap with same content as the starting BitmapImage. Note that UriSource might be null in some cases - even if the BitmapImage was loaded by giving it a URI - it might be reset manually or by setting CacheMode to BitmapCache on an Image that's using the given BitmapImage as its Source.

提交回复
热议问题