System.Drawing.Drawing2D.HatchBrush.HatchHorizontalBrick C# (CSharp) Method

HatchHorizontalBrick() static private method

static private HatchHorizontalBrick ( CGContext context ) : void
context CGContext
return void
        void HatchHorizontalBrick(CGContext context)
        {
            var hatchWidth = getHatchWidth (hatchStyle);
            var hatchHeight = getHatchHeight (hatchStyle);
            var lineWidth = getLineWidth (hatchStyle);

            initializeContext(context, hatchHeight, false);

            /* draw background */
            drawBackground (context, backColor, hatchWidth, hatchHeight);

            /* draw lines in the foreground color */
            context.SetFillColor(foreColor.ToCGColor());

            /* draw lines in the foreground color */
            context.SetStrokeColor(foreColor.ToCGColor());
            context.SetLineWidth(lineWidth);
            context.SetLineCap(CGLineCap.Square);

            CGRect rect = new CGRect (0,0,1,1);

            rect.Y = 3;
            rect.Width = hatchWidth;
            rect.Height = hatchHeight - 4;
            context.StrokeRect(rect);

            context.MoveTo(hatchWidth / 2.0f, 0);
            context.AddLineToPoint(hatchWidth / 2.0f,3);
            context.StrokePath();
        }