Пример #1
0
        private PointF GetGraphicsPoint(Vector X)
        {
            Vector NewX = new Vector(X);

            NewX.Values[0] += X_o.Values[0];
            NewX.Values[1]  = X_o.Values[1] - NewX.Values[1];
            return(DrawingTools.GetGraphicsPoint(NewX));
        }
Пример #2
0
        public void AddColorScale(ref Graphics g)
        {
            Vector V_Width = new Vector(2);

            V_Width.Values[0] = ScaleWidth;
            Vector V_Height = new Vector(2);

            V_Height.Values[1] = ScaleHeight;

            int    NCB  = NumberOfColorBlocks;
            double NCBD = Convert.ToDouble(NCB);
            Vector DH   = V_Height / NCBD;

            for (int i = 0; i < NCB; i++)
            {
                Vector     CB_TopLeft = TopLeft + Convert.ToDouble(i) * DH;
                Color      fillColor  = OOPsColor.ColorScale(1.0D - Convert.ToDouble(i) / (NCBD - 1.0D));
                SolidBrush brush      = new SolidBrush(fillColor);
                DrawingTools.FillRectangle(g, brush, CB_TopLeft, ScaleWidth, DH.Values[1]);
            }
            Vector TopRight    = TopLeft + V_Width;
            Vector BottomRight = TopRight + V_Height;

            DrawingTools.DrawLine(g, AxisPen, TopRight, BottomRight);

            double NTicksD = Convert.ToDouble(NumberOfTicks);

            V_Height.Values[1] -= LineWidth;
            DH = V_Height / (NTicksD - 1.0D);
            Vector Start = TopRight;

            Start.Values[1] += LineWidth / 2.0D;
            Vector End = new Vector(Start);

            End.Values[0] += TickLength;
            for (int i = 0; i < NumberOfTicks; i++)
            {
                Vector H = Convert.ToDouble(i) * DH;
                DrawingTools.DrawLine(g, AxisPen, Start + H, End + H);
                Vector TitleTopC = End + H;
                TitleTopC.Values[0] += TickPad + ScaleText[i].Width / 2.0D;
                TitleTopC.Values[1] -= ScaleText[i].Height / 2.0D;
                ScaleText[i].DrawTitle(g, TitleTopC);
            }
        }