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

HatchDivot() static private method

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

            float halfMe = hatchWidth / 2.0f;

            // draw a little wirly thingy
            CGRect rect = new CGRect (0,0,1,1);
            setPixels(context, rect);

            rect.X += 1;
            rect.Y += 1;
            setPixels(context, rect);

            rect.X -= 1;
            rect.Y += 1;
            setPixels(context, rect);

            // now top one
            rect.X = halfMe;// + HALF_PIXEL_X;
            rect.Y = halfMe;// + HALF_PIXEL_Y;
            setPixels(context, rect);

            rect.X -= 1;
            rect.Y += 1;
            setPixels(context, rect);

            rect.X += 1;
            rect.Y += 1;
            setPixels(context, rect);
        }