ComponentFactory.Krypton.Toolkit.RenderStandard.EvalTransparentPaint C# (CSharp) Method

EvalTransparentPaint() public method

Evaluate if transparent painting is needed for background or border palettes.
public EvalTransparentPaint ( IPaletteBack paletteBack, IPaletteBorder paletteBorder, PaletteState state ) : bool
paletteBack IPaletteBack Background palette to test.
paletteBorder IPaletteBorder Background palette to test.
state PaletteState Element state associated with palette.
return bool
        public override bool EvalTransparentPaint(IPaletteBack paletteBack,
                                                  IPaletteBorder paletteBorder,
                                                  PaletteState state)
        {
            int rounding = paletteBorder.GetBorderRounding(state);

            // If the border takes up some visual space
            if (paletteBorder.GetBorderWidth(state) > 0)
            {
                // If the border is not being painted then it must be transparent
                if (paletteBorder.GetBorderDraw(state) == InheritBool.False)
                    return true;
                else
                {
                    // If there is rounding causing transparent corners
                    if (paletteBorder.GetBorderRounding(state) > 0)
                        return true;
                    else
                    {
                        // If the first color has alpha channel then has transparency
                        if (paletteBorder.GetBorderColor1(state).A < 255)
                            return true;
                        else
                        {
                            // Does the draw style require use of the second color?
                            if (paletteBorder.GetBorderColorStyle(state) != PaletteColorStyle.Solid)
                            {
                                // If the second color has alpha channel then has transparency
                                if (paletteBorder.GetBorderColor2(state).A < 255)
                                    return true;
                            }
                        }
                    }
                }
            }

            // The border does not cause transparency, check the background
            return EvalTransparentPaint(paletteBack, state);
        }

Same methods

RenderStandard::EvalTransparentPaint ( IPaletteBack paletteBack, PaletteState state ) : bool
RenderStandard