Пример #1
0
        protected override void CreateBarsOverride(IElementFactory factory)
        {
            RectangleF barRect1 = this.barRect;
            RectangleF barRect2 = this.barRect;

            if (this.ShowText)
            {
                switch (this.LineAlign)
                {
                case StringAlignment.Near:
                    barRect1.Y      -= this.leftSize.Height / 2f;
                    barRect1.Height += this.leftSize.Height / 2f;
                    break;

                case StringAlignment.Far:
                    barRect1.Height += this.leftSize.Height / 2f;
                    break;
                }
            }
            int length = this.pattern.Length;
            int num1   = 0;
            int index  = 0;

            for (; num1 < length; num1 = index)
            {
                while (index < length && (int)this.pattern[index] == (int)Symbology1D.TagChar)
                {
                    ++index;
                }
                int num2 = index - num1;
                if (num2 > 0)
                {
                    RectangleF rect = barRect1;
                    rect.X    += barRect1.Width * (float)num1 / (float)length;
                    rect.Width = barRect1.Width * (float)num2 / (float)length;
                    factory.CreateBarElement(rect);
                }
                int num3 = index;
                while (index < length && (int)this.pattern[index] == (int)Symbology1D.BarChar)
                {
                    ++index;
                }
                int num4 = index - num3;
                if (num4 > 0)
                {
                    RectangleF rect = barRect2;
                    rect.X    += barRect2.Width * (float)num3 / (float)length;
                    rect.Width = barRect2.Width * (float)num4 / (float)length;
                    factory.CreateBarElement(rect);
                }
                while (index < length && (int)this.pattern[index] == (int)Symbology1D.GapChar)
                {
                    ++index;
                }
            }
        }
Пример #2
0
        public void CreateElements(IElementFactory factory, Rectangle bounds)
        {
            int length1 = this.dataMatrix.GetLength(0);
            int length2 = this.dataMatrix.GetLength(1);
            int left    = bounds.Left;
            int top     = bounds.Top;
            int width   = bounds.Width / this.dataMatrix.GetLength(1);
            int height  = bounds.Height / this.dataMatrix.GetLength(0);
            List <Rectangle> rectangleList = new List <Rectangle>();

            for (int index1 = 0; index1 < length1; ++index1)
            {
                for (int index2 = 0; index2 < length2; ++index2)
                {
                    if (this.dataMatrix[index1, index2])
                    {
                        Rectangle rectangle = new Rectangle(left + index2 * width, top + index1 * height, width, height);
                        rectangleList.Add(rectangle);
                    }
                }
            }
            factory.ClearElements();
            foreach (Rectangle rectangle in rectangleList)
            {
                RectangleF rect = (RectangleF)rectangle;
                factory.CreateBarElement(rect);
            }
        }
Пример #3
0
        protected override void CreateBarsOverride(IElementFactory factory)
        {
            int length = this.pattern.Length;
            int num1   = 0;
            int index  = 0;

            for (; num1 < length; num1 = index)
            {
                while (index < length && (int)this.pattern[index] == (int)Symbology1D.BarChar)
                {
                    ++index;
                }
                int num2 = index - num1;
                if (num2 > 0)
                {
                    RectangleF barRect = this.barRect;
                    barRect.X    += this.barRect.Width * (float)num1 / (float)length;
                    barRect.Width = this.barRect.Width * (float)num2 / (float)length;
                    factory.CreateBarElement(barRect);
                }
                while (index < length && (int)this.pattern[index] == (int)Symbology1D.GapChar)
                {
                    ++index;
                }
            }
        }
Пример #4
0
        protected override void CreateBarsOverride(IElementFactory factory)
        {
            RectangleF barRect = this.barRect;
            float      x       = barRect.X + (float)(this.TotalHorizontalClearZone / 2);
            int        num1    = (int)((double)barRect.Width - (double)this.TotalHorizontalClearZone) / 65;
            int        num2    = (int)Math.Max(1.0, (double)num1 * 0.2);

            barRect.Y      += (float)(this.TotalVerticalClearZone / 2);
            barRect.Height -= (float)this.TotalVerticalClearZone;
            if (num1 <= 0 || (double)barRect.Height <= 0.0)
            {
                return;
            }
            foreach (char ch in this.pattern)
            {
                switch (ch)
                {
                case 'A':
                    factory.CreateBarElement(new RectangleF(x, barRect.Y, (float)(num1 - num2), (float)((double)barRect.Height * 2.0 / 3.0)));
                    break;

                case 'D':
                    factory.CreateBarElement(new RectangleF(x, barRect.Y + barRect.Height / 3f, (float)(num1 - num2), (float)((double)barRect.Height * 2.0 / 3.0)));
                    break;

                case 'F':
                    factory.CreateBarElement(new RectangleF(x, barRect.Y, (float)(num1 - num2), barRect.Height));
                    break;

                case 'T':
                    factory.CreateBarElement(new RectangleF(x, barRect.Y + barRect.Height / 3f, (float)(num1 - num2), barRect.Height / 3f));
                    break;
                }
                x += (float)num1;
            }
        }
Пример #5
0
        protected override void CreateBarsOverride(IElementFactory factory)
        {
            int length = this.pattern.Length;

            for (int index = 0; index < length; ++index)
            {
                RectangleF barRect = this.barRect;
                barRect.X    += this.barRect.Width * (float)index / (float)length;
                barRect.Width = this.barRect.Width * 0.5f / (float)length;
                if ((int)this.pattern[index] == (int)Symbology1D.GapChar)
                {
                    barRect.Y     += this.barRect.Height * 0.5f;
                    barRect.Height = this.barRect.Height * 0.5f;
                }
                factory.CreateBarElement(barRect);
            }
        }