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

HatchHorizontal() protected method

protected HatchHorizontal ( CGContext context ) : void
context CGContext
return void
        protected void HatchHorizontal(CGContext context)
        {
            var hatchSize = getHatchWidth (hatchStyle);
            var lineWidth = getLineWidth (hatchStyle);

            initializeContext(context, hatchSize, false);

            /* draw background */
            drawBackground (context, backColor, hatchSize, hatchSize);

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

            // draw a horizontal line
            context.MoveTo(0,0);
            context.AddLineToPoint(hatchSize, 0);

            context.StrokePath();
        }