0

In a listbox , i show flag icon for every row . and i use xaml image control in template of listbox item. after resizing the png files ( flag icons ) , they lose their quality and they are not smooth any more ... what should i do with this problem ? for example in wpf there is a property RenderOptions.BitmapScalingMode for managing the quality . but i did not see anything in windows phone ... i was wondering if you guide me how can i fix this issue. Thanks a lot

<Image Source="{Binding Icon}" Height="50" Width="50" Stretch="Fill" Margin="0,10,0,0"/>
peyman gilmour
  • 1,168
  • 2
  • 16
  • 35

2 Answers2

1

RenderOptions.BitmapScalingMode does not exist in Windows-Phone.

But if you really want to do this code wise without vector images you can do it using Phone 8.1 SDK

Check out BitmapEncoder class. BitmapEncoder as part of the Windows.Graphics.Imaging Namespace.

BitmapEncoder.BitmapTransform.InterpolationMode is what you're looking for.

Chubosaurus Software
  • 8,133
  • 2
  • 20
  • 26
1

You could use the Bitmap to deliver the image with the same quality:

Image image = new Image();

Uri uri = new Uri(“images/single-pink-rose.png”, UriKind.Relative);

ImageSource img = new System.Windows.Media.Imaging.BitmapImage(uri);

image.SetValue(Image.SourceProperty, img);

Refer here for more: How to Reduce Size of Image in windows phone

How do I resize a BitmapImage to 50x50 on Windows Phone 7?

Hope it helps!

Community
  • 1
  • 1
Kulasangar
  • 9,046
  • 5
  • 51
  • 82