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

HatchConfetti() static private method

static private HatchConfetti ( CGContext context ) : void
context CGContext
return void
        void HatchConfetti(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 confetti Rectangles in the foreground color */
            context.SetFillColor(foreColor.ToCGColor());

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

            // Do not see a mathematical equation so will just set
            // the same ones as in windows pattern.
            if (hatchStyle == HatchStyle.LargeConfetti)
            {
                setPixels(context, rect);

                rect.X = 2;
                rect.Y = 2;
                setPixels(context, rect);

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

                rect.X = 6;
                rect.Y = 4;
                setPixels(context, rect);

                rect.X = 4;
                rect.Y = 6;
                setPixels(context, rect);

                rect.X = 1;
                rect.Y = 5;
                setPixels(context, rect);
            }
            else
            {
                rect.Width = 1;
                rect.Height = 1;

                setPixels(context, rect);

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

                rect.X = 6;
                rect.Y = 2;
                setPixels(context, rect);

                rect.X = 2;
                rect.Y = 3;
                setPixels(context, rect);

                rect.X = 7;
                rect.Y = 4;
                setPixels(context, rect);

                rect.X = 4;
                rect.Y = 5;
                setPixels(context, rect);

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

                rect.X = 5;
                rect.Y = 7;
                setPixels(context, rect);

            }
        }