Quantcast
Viewing all articles
Browse latest Browse all 18858

OpacityMask strange behaviour

Hi! I have a problem using both OpacityMask and Clip properties of UIElement.

When I set these two properties, then two unnecessary lines appears at the left and right sides of the UIElement.

This markup helps to reproduce a problem:

<StackPanel Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Border Width="220" Height="200" Background="Black" OpacityMask="Black">
                <Border.Clip>
                    <RectangleGeometry Rect="-1, 0, 222, 220"></RectangleGeometry>
                </Border.Clip>
            </Border>
            <Border Width="220" Height="220" Background="Black">
                <Border.Clip>
                    <RectangleGeometry Rect="-1, 0, 222, 222"></RectangleGeometry>
                </Border.Clip>
            </Border>
        </StackPanel>

The only difference between two borders - OpacityMask property of the first border is not null.

Is there any workaround to hide these artifacts? (Yes, I know about the RenderOptions.EdgeMode property, but I cannot use it, because I am using the Ellipse control in my application).


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>