예제 #1
0
    View CreateUpperColorView(Size size, BlendEquationType blendEquationType)
    {
        View baseView = new View()
        {
            Size   = size,
            Layout = new LinearLayout()
            {
                LinearOrientation = LinearLayout.Orientation.Vertical,
            },
        };

        float yPositionScale = (float)(size.Height) / 3.0f;
        View  colorView1     = new View()
        {
            BlendEquation = blendEquationType,
            Size          = new Size(size.Width, size.Height / 3),

            Background = new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
                         .Add(ColorVisualProperty.MixColor, new PropertyValue(Color.Red))
                         .Add(Visual.Property.PremultipliedAlpha, new PropertyValue(true)),
        };
        View colorView2 = new View()
        {
            BlendEquation = blendEquationType,
            Size          = new Size(size.Width, size.Height / 3),

            Background = new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
                         .Add(ColorVisualProperty.MixColor, new PropertyValue(Color.Green))
                         .Add(Visual.Property.PremultipliedAlpha, new PropertyValue(true)),
        };
        View colorView3 = new View()
        {
            BlendEquation = blendEquationType,
            Size          = new Size(size.Width, size.Height / 3),

            Background = new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
                         .Add(ColorVisualProperty.MixColor, new PropertyValue(Color.Blue))
                         .Add(Visual.Property.PremultipliedAlpha, new PropertyValue(true)),
        };

        baseView.Add(colorView1);
        baseView.Add(colorView2);
        baseView.Add(colorView3);

        return(baseView);
    }
예제 #2
0
    void AddBlendEquationItem(BlendEquationType blendEquationType)
    {
        View baseView = new View()
        {
            Size = sampleBoxSize,
        };

        ImageView lowerImageView = CreateLowerImageView();

        lowerImageView.Size = sampleBoxSize;
        baseView.Add(lowerImageView);

        View upperColorView = CreateUpperColorView(sampleBoxSize, blendEquationType);

        baseView.Add(upperColorView);

        AddItem(baseView, $"view.BlendEquation = \n    BlendEquationType.{blendEquationType};");
    }
예제 #3
0
 public static bool IsBlendEquationSupported(BlendEquationType blendEquation)
 {
     return(Interop.GraphicsCapabilities.IsBlendEquationSupported((int)blendEquation));
 }