即使在 RenderOptions.SetBitmapScalingMode 为 HighQuality 之后,我的图像质量也很低
即使在 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];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过在主窗口中添加 RenderOptions.SetBitmapScalingMode 最终使其工作。感谢 stefanOlson http://www.olsonsoft.com/blogs/stefanolson/post/Workaround-for-low-quality-bitmap-resizing-in-WPF-4.aspx
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