簡體   English   中英

如何在不損失質量的情況下從StorageFile設置Image.Source?

[英]How can I set an Image.Source from a StorageFile without losing quality?

是我發現並起作用的一種方法,但是如果我的圖像變得大於此處的值,則會失去質量。 我的圖像也沒有固定尺寸,因此我希望以原始質量獲得它。

using (IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
    BitmapImage bitmapImage = new BitmapImage();
    await bitmapImage.SetSourceAsync(fileStream);
    myImage.Source = bitmapImage;
}

不考慮高度和寬度,我將獲得完整的圖像!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM