
Untitled
By: a guest on
Jul 15th, 2012 | syntax:
None | size: 0.63 KB | hits: 10 | expires: Never
Imagescaling looking bad in Ribbon
BitmapImage img = new BitmapImage();
try
{
Uri uri = new Uri("pack://application:,,,/UIMainWindow;component/Resources/" + iPictureName);
img.BeginInit();
img.SetValue(BitmapImage.CacheOptionProperty, BitmapCacheOption.OnLoad);
RenderOptions.SetBitmapScalingMode(img, BitmapScalingMode.HighQuality);
img.UriSource = uri;
img.EndInit();
img.Freeze();
}
catch (Exception ex)
{
throw new Exception("Creation of image failed: " + ex.Message, ex);
}