-1

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

Bayo Alen
  • 341
  • 1
  • 6
  • 13

1 Answers1

5

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);
    ...........
 }
Bayo Alen
  • 341
  • 1
  • 6
  • 13