예제 #1
0
        public void DrawAllPicture()
        {
            Bitmap bmp = new Bitmap(size.Width, size.Height);

            bmp = DrawGrid(bmp, 40); //рисуем сетку
            bmp = DrawAxes(bmp);     //рисуем оси
            bmp = DrawL(bmp);        // рисуем линию
            bmp = BresenhamLine(bmp, sc.II(p1.X), sc.JJ(p1.Y + 0), sc.II(p2.X), sc.JJ(p2.Y + 0), Color.Gray,
                                widthSplit, heightSplit);

            G.DrawImage(bmp, 0, 0);
            bmp.Dispose();
        }
예제 #2
0
        void OX()//ось х
        {
            g.DrawLine(Pens.LightBlue, conv.II(conv.x1), conv.JJ(0), conv.II(conv.x2), conv.JJ(0));
            double h1     = HH(conv.x1, conv.x2);
            int    k1     = (int)Math.Round(conv.x1 / h1) - 1;
            int    k2     = (int)Math.Round(conv.x2 / h1);
            byte   Digits = GetDigits(Math.Abs(conv.x2 - conv.x1));

            for (int i = k1; i <= k2; i++)
            {
                g.DrawLine(MyPen2, conv.II(i * h1), conv.JJ(0) - 7, conv.II(i * h1), conv.JJ(0) + 7);
                for (int j = 1; j <= 9; j++)
                {
                    g.DrawLine(MyPen2, conv.II(i * h1 + j * h1 / 10), conv.JJ(0) - 3, conv.II(i * h1 + j * h1 / 10), conv.JJ(0) + 3);
                }
                string s = Convert.ToString(Math.Round(h1 * i, Digits));
                g.DrawString(s, aFont, Brushes.Black, conv.II(i * h1) - 5, conv.JJ(0) - 13);
            }
        }