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

HatchOutlinedDiamond() static private method

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

            // this is really just two diagonal lines from each corner too
            // their opposite corners.
            context.MoveTo(0,0);
            context.AddLineToPoint(hatchWidth, hatchHeight);
            context.StrokePath();
            context.MoveTo(1,hatchHeight);
            context.AddLineToPoint(hatchWidth, 1);
            context.StrokePath();
        }