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

HatchWeave() static private method

static private HatchWeave ( CGContext context ) : void
context CGContext
return void
        void HatchWeave(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);

            float halfWidth = hatchWidth / 2.0f;
            float halfHeight = hatchHeight / 2.0f;

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

            // Add upward diagonals
            context.MoveTo(0,0);
            context.AddLineToPoint(halfWidth, halfHeight);
            context.StrokePath();

            context.MoveTo(0, halfHeight);
            context.AddLineToPoint(halfWidth -1, hatchHeight - 1);
            context.StrokePath();

            context.MoveTo(halfWidth, 0);
            context.AddLineToPoint(6, 2);
            context.StrokePath();

            //			context.MoveTo(0, 4);
            //			context.AddLineToPoint(2, 2);
            //			context.StrokePath();

            context.MoveTo(2,6);
            context.AddLineToPoint(7, 1);
            context.StrokePath();
        }