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

HatchDashedHorizontal() static private method

static private HatchDashedHorizontal ( CGContext context ) : void
context CGContext
return void
        void HatchDashedHorizontal(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.SetStrokeColor(foreColor.ToCGColor());
            context.SetLineWidth(lineWidth);
            context.SetLineCap(CGLineCap.Square);

            float halfMe = hatchHeight / 2.0f - 1;
            hatchWidth -=1;
            hatchHeight -= 1;

            context.MoveTo(halfMe+1, halfMe);
            context.AddLineToPoint(hatchWidth, halfMe);
            context.StrokePath();

            context.MoveTo(0,hatchHeight);
            context.AddLineToPoint(halfMe, hatchHeight);
            context.StrokePath();
        }