protected override void OnPaint(PaintEventArgs e)
        {
            if (!isDrawn)
            {
                Graphics g = this.CreateGraphics();
                Block block = new Block(Brushes.Invisible, g, 0, 0, 0, 0, false);
                block = new Row1().AddRow(block);
                block = new Row2().AddRow(block);
                block = new Row3().AddRow(block);
                block = new Row4().AddRow(block);
                block = new Row5().AddRow(block);
                block = new Row6().AddRow(block);
                block = new Row7().AddRow(block);
                block = new Row8().AddRow(block);
                block = new Row9().AddRow(block);
                block = new Row10().AddRow(block);
                block = new Row11().AddRow(block);
                block = new Row12().AddRow(block);
                block = new Row13().AddRow(block);
                block = new Row14().AddRow(block);

                if (DrawDiamondOnlyAtEnd) CutOutDiamond(g);

                isDrawn = true;
            }
            base.OnPaint(e);
        }
Example #2
0
        public Block AddRowsRight(int width, int[] ycoords, Brush[] brushes)
        {
            if (ycoords.Length != brushes.Length)
                throw new NotSupportedException("Amount ycoords must be the same as amount brushes");

            if (ycoords.Length < 1) return null;

            Block b = new Block(brushes[0], Graphics, OffsetLeft + Width, OffsetTop, width, ycoords[0] - OffsetTop);
            for (int i = 1; i < ycoords.Length; i++)
            {
                b = b.AddBelow(brushes[i], ycoords[i] - ycoords[i - 1]);
            }
            return b;
        }
Example #3
0
        public Block AddRowLeftToRight(int offsetLeft, int offsetTop, int height, 
            int[] xcoords, Brush[] brushes)
        {
            if(xcoords.Length != brushes.Length)
                throw new NotSupportedException("Amount xcoords must be the same as amount brushes");

            if (xcoords.Length < 1) return null;

            Block b = new Block(brushes[0], Graphics, offsetLeft, offsetTop, xcoords[0] - offsetLeft, height);
            for(int i = 1; i < xcoords.Length; i++)
            {
                b = b.AddRight(brushes[i], xcoords[i] - xcoords[i - 1]);
            }
            return b;
        }