XAML Image Quality (interpolation) in a Metro-Style App

前端 未结 2 1301
Happy的楠姐
Happy的楠姐 2021-01-13 08:24

Given the following Image object (it\'s in the DataTemplate of a ListView object):

  

        
相关标签:
2条回答
  • 2021-01-13 08:33

    I faced the same image quality problem in my WinRT application, and tried to use RenderOptions.BitmapScalingMode but it is not present (and System.Windows.Media namespace as well) in .NET for Windows Store. So I tried your first solution and fixed it so that works. You were one small step from success, only need to add

    ras.Seek(0);
    

    to allow reading the stream from the beginning.

    0 讨论(0)
  • 2021-01-13 08:42

    I know it is a little bit late, but it may be a useful reference for someone else. There's no need for such handler: you only need to set the value of the RenderOptions.BitmapScalingMode attached property.

    <Image Source="{Binding ImgSource}" ImageOpened="img_ImageOpened" RenderOptions.BitmapScalingMode="HighQuality" />
    
    0 讨论(0)
提交回复
热议问题