microsoft/Win2D

CrossFadeEffect output oppsite as documentation?

HO-COOH opened this issue · 0 comments

I have this code

    <Border Width="200" Height="200" Loaded="Border_Loaded"/>
        private void Border_Loaded(object sender, RoutedEventArgs e)
        {
            var color1 = new ColorSourceEffect()
            {
                Color = Windows.UI.Color.FromArgb(255, 255, 0, 0)
            };

            var color2 = new ColorSourceEffect()
            {
                Color = Windows.UI.Color.FromArgb(255, 0, 255, 0)
            };

            var crossFadeEffect = new CrossFadeEffect()
            {
                Source1 = color1,
                Source2 = color2,
                CrossFade = 0.0F
            };

            var host = sender as UIElement;
            var compositor = ElementCompositionPreview.GetElementVisual(host).Compositor;
            var brush = compositor.CreateEffectFactory(crossFadeEffect).CreateBrush();
            var visual = compositor.CreateSpriteVisual();
            visual.Size = host.ActualSize;
            visual.Brush = brush;
            ElementCompositionPreview.SetElementChildVisual(host, visual);
        }

So apparently according to doc,
image

when CrossFade=0, it should outputs color1, which is Red, but it shows me color2 instead. How is this possible?
image

Reproduce here