Answer the question
In order to leave comments, you need to log in
How to change scaling algorithm to icon in window (WPF)?
If a large image is displayed at a size smaller than the original, then "pixelation" artifacts begin to appear:
But this can be solved by specifying an attribute of the object, in XAML, a scaling algorithm with a higher quality:
<Image Height="50" Width="50"
Source="Resources/logo.png"
RenderOptions.BitmapScalingMode="HighQuality" />
<Window x:Class="MyApp.AboutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:MyApp.Properties"
Title="{x:Static res:Resources.AboutWindowTitle}"
Height="450" Width="300"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
Icon="Resources/info.png">
...
Answer the question
In order to leave comments, you need to log in
In general, any scaling leads to a loss of quality. No smoothing of a situation does not rescue.
As for the icon in the window title, it is not rendered by WPF, as far as I know, but by dwm itself, so nothing can be solved with markup. Unless you make a custom header.
It is best to draw the icon size to size. Or several icons for different dpi. At least that's how we deal with pictures in our projects.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question