Note that there are some explanatory texts on larger screens.

plurals
  1. POCheckbox path aliasing
    primarykey
    data
    text
    <p>I have created a checkbox in WPF it works but looks really ugly the tick in the box is very jagged. I have tried to set the RenderOptions.EdgeMode to aliased but that hasn't fixed it, am I missing something?</p> <p>the code is as follows:</p> <pre><code>&lt;Style x:Key="{x:Type CheckBox}" TargetType="CheckBox"&gt; &lt;Setter Property="SnapsToDevicePixels" Value="true"/&gt; &lt;Setter Property="OverridesDefaultStyle" Value="true"/&gt; &lt;Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" /&gt; &lt;Setter Property="Foreground" Value="{StaticResource FGBrush}"/&gt; &lt;Setter Property="HorizontalContentAlignment" Value="Stretch"/&gt; &lt;Setter Property="VerticalContentAlignment" Value="Stretch"/&gt; &lt;Setter Property="RenderOptions.EdgeMode" Value="Aliased"/&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="CheckBox"&gt; &lt;BulletDecorator Background="Transparent"&gt; &lt;BulletDecorator.Bullet&gt; &lt;Grid Width="12" Height="12" MinHeight="{DynamicResource ResourceKey=MinimumIteractSizeDips}" MinWidth="{DynamicResource ResourceKey=MinimumIteractSizeDips}" SnapsToDevicePixels="True" RenderOptions.EdgeMode="Aliased"&gt; &lt;Border x:Name="Border" BitmapEffect="{StaticResource DropShadow}" MinHeight="{DynamicResource ResourceKey=MinimumIteractSizeDips}" MinWidth="{DynamicResource ResourceKey=MinimumIteractSizeDips}" CornerRadius="0" Background="{StaticResource GreyGradientBrush}" BorderThickness="1" BorderBrush="{StaticResource NormalBorderBrush}" RenderOptions.EdgeMode="Aliased"&gt; &lt;!--&lt;Path Stretch="Fill" Margin="3" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="{StaticResource GlyphBrush}" StrokeThickness="3" Fill="{DynamicResource GlyphBrush}" RenderOptions.EdgeMode="Aliased" Data="M103.78572,598.96112 L105.09846,597.5661 L107.00806,600.16229 C107.00806,600.16229 109.91004,592.74463 109.91004,592.74463 C109.91004,592.74463 111.74678,593.79761 111.74678,593.79761 C111.74678,593.79761 107.88566,602.75848 107.88566,602.75848 L106.60118,602.75848 z" /&gt;--&gt; &lt;Path Stretch="Fill" Margin="3" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="{StaticResource GlyphBrush}" StrokeThickness="3" Fill="{DynamicResource GlyphBrush}" RenderOptions.EdgeMode="Aliased" Data="M103.78572,598.96112 L105.09846,597.5661 L107.00806,600.16229 C107.00806,600.16229 109.91004,592.74463 109.91004,592.74463 C109.91004,592.74463 111.74678,593.79761 111.74678,593.79761 C111.74678,593.79761 107.88566,602.75848 107.88566,602.75848 L106.60118,602.75848 z" /&gt; &lt;/Border&gt; &lt;/Grid&gt; &lt;/BulletDecorator.Bullet&gt; &lt;ContentPresenter Margin="4,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True"/&gt; &lt;/BulletDecorator&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property="IsChecked" Value="false"&gt; &lt;Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/&gt; &lt;/Trigger&gt; &lt;!--&lt;Trigger Property="IsChecked" Value="{x:Null}"&gt; &lt;Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" /&gt; &lt;/Trigger&gt;--&gt; &lt;Trigger Property="IsMouseOver" Value="true"&gt; &lt;Trigger.EnterActions&gt; &lt;BeginStoryboard Name="HighlightAnim"&gt; &lt;Storyboard TargetName="Border" TargetProperty="Opacity" &gt; &lt;DoubleAnimation To="0.5" Duration="00:00:00.1"/&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/Trigger.EnterActions&gt; &lt;Trigger.ExitActions&gt; &lt;StopStoryboard BeginStoryboardName="HighlightAnim"/&gt; &lt;/Trigger.ExitActions&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsPressed" Value="true"&gt; &lt;Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" /&gt; &lt;Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" /&gt; &lt;/Trigger&gt; &lt;Trigger Property="IsEnabled" Value="false"&gt; &lt;Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" /&gt; &lt;Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" /&gt; &lt;Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload