System.Drawing.SolidBrush.Setup C# (CSharp) Method

Setup() private method

private Setup ( Graphics graphics, bool fill ) : void
graphics Graphics
fill bool
return void
        internal override void Setup(Graphics graphics, bool fill)
        {
            if (graphics.LastBrush == this && !isModified)
                return;

            bool sourceCopy = graphics.CompositingMode == CompositingMode.SourceCopy;
            if (fill){
                graphics.context.SetFillColor(color.R / 255f, color.G/255f, color.B/255f, sourceCopy ? 1f : color.A/255f );

            } else {
                graphics.context.SetStrokeColor(color.R / 255f, color.G/255f, color.B/255f, sourceCopy ? 1f : color.A/255f );
            }

            graphics.LastBrush = this;
            isModified = false;

            // I am setting this to be used for Text coloring in DrawString
            graphics.lastBrushColor = color;
        }