任何人都可以建议何时SnapsToDevicePixels在WPF 4.0中使用?
它是否应该仅在有问题的情况下偶尔使用,在整个应用程序中,只在某些控件或什么?
我想通过使用库WPF Animated GIF来显示GIF。但是PictureSource设置属性后,进程内存从208MB上升到1GB。为什么?
<Image Name="content" MaxHeight="240" MaxWidth="340"
RenderOptions.BitmapScalingMode="LowQuality"
Width="340" Height="240"
MinWidth="340" MinHeight="240"
gif:ImageBehavior.AutoStart="True"
gif:ImageBehavior.AnimatedSource="{Binding Path=PictureSource}">
<Image.Stretch>
<MultiBinding Converter="{StaticResource ImageStretchConverter}">
<Binding Path="PictureSource" />
<Binding ElementName="content" Path="Source.Width" />
<Binding ElementName="content" Path="Source.Height" />
</MultiBinding>
</Image.Stretch>
<Image.BitmapEffect>
<BlurBitmapEffect Radius="0" />
</Image.BitmapEffect>
<Image.CacheMode>
<BitmapCache EnableClearType="True"
RenderAtScale="0.2"
SnapsToDevicePixels="True"/>
</Image.CacheMode>
<!--<Image.Source>
<BitmapImage StreamSource="{Binding Path=PictureSource}" UriSource="{Binding Path=PictureSource}"
DecodePixelWidth="340" DecodePixelHeight="240"/>
</Image.Source>-->
</Image>
Run Code Online (Sandbox Code Playgroud)
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
string path = values[0] …Run Code Online (Sandbox Code Playgroud)