即使在 RenderOptions.SetBitmapScalingMode 为 HighQuality 之后,我的图像质量也很低

发布于 2024-12-10 15:13:25 字数 943 浏览 0 评论 0原文

即使在 RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality); 之后,我的图像质量也很低。 任何想法

        if(File.Exists(image_file.FullName))
        {
            IPLRes.print( "Loading " + image_file.FullName);
            BitmapImage thumbImg = new BitmapImage(new Uri(image_file.FullName));
            RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality);
            ImageBrush imgbrush = new ImageBrush(thumbImg);
            imgbrush.Stretch = System.Windows.Media.Stretch.Uniform;
            RenderedPages[page_numx] = imgbrush;

        }

......

ShapRectangle thumbnail = (ShapRectangle)FindName("rect_Thumb" + thumbnail_nbr);
VISUAL thumbnailvisual = (VISUAL)FindName("rect_Thumb" + thumbnail_nbr);
thumbnail.Fill = (System.Windows.Media.Brush)RenderedPages[page_numx];

在此处输入图像描述

i am having low quality image even after RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality);
Any idea

        if(File.Exists(image_file.FullName))
        {
            IPLRes.print( "Loading " + image_file.FullName);
            BitmapImage thumbImg = new BitmapImage(new Uri(image_file.FullName));
            RenderOptions.SetBitmapScalingMode(thumbImg, BitmapScalingMode.HighQuality);
            ImageBrush imgbrush = new ImageBrush(thumbImg);
            imgbrush.Stretch = System.Windows.Media.Stretch.Uniform;
            RenderedPages[page_numx] = imgbrush;

        }

.....

ShapRectangle thumbnail = (ShapRectangle)FindName("rect_Thumb" + thumbnail_nbr);
VISUAL thumbnailvisual = (VISUAL)FindName("rect_Thumb" + thumbnail_nbr);
thumbnail.Fill = (System.Windows.Media.Brush)RenderedPages[page_numx];

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的痛♀有谁懂 2024-12-17 15:13:25

我通过在主窗口中添加 RenderOptions.SetBitmapScalingMode 最终使其工作。感谢 stefanOlson http://www.olsonsoft.com/blogs/stefanolson/post/Workaround-for-low-quality-bitmap-resizing-in-WPF-4.aspx

MainWindow()
 { 
  InitializeComponent();
  RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.Fant);
    ...........
 }

i was able to make it work finaly by adding the RenderOptions.SetBitmapScalingMode in the main window. thanks to stefanOlson http://www.olsonsoft.com/blogs/stefanolson/post/Workaround-for-low-quality-bitmap-resizing-in-WPF-4.aspx

MainWindow()
 { 
  InitializeComponent();
  RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.Fant);
    ...........
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文