コード例 #1
0
        private void dibujarEjes()
        {
            if (G.Escenario.EjeVisible)
            {
                Pen      pen = new Pen(Color.Red);
                Graphics gr  = PanelDibujo.CreateGraphics();
                G.Pintor = new Pintor(ref gr, pen);

                List <Punto> py = new List <Punto>();
                py.Add(new Punto(G.Escenario.Centro.X, 0));
                py.Add(new Punto(G.Escenario.Centro.X, PanelDibujo.Height));
                Poligono ejey = new Poligono(py, Poligono.TipoPoligono.Abierto);

                Poligono ejex = new Poligono(new Punto(0, G.Escenario.Centro.Y));
                ejex.Add(new Punto(PanelDibujo.Width, G.Escenario.Centro.Y));
                ejex.Tipo_Poligono = Poligono.TipoPoligono.Abierto;

                G.Pintor.dibujarPoligono(ejey);//poligonos absolutos
                G.Pintor.dibujarPoligono(ejex);
            }
        }
コード例 #2
0
        private void dibujarTemporales()
        {
            Pen      pen = new Pen(Color.Blue);
            Graphics gr  = PanelDibujo.CreateGraphics();

            G.Pintor = new Pintor(ref gr, pen);

            if (nPuntos == 1)
            {
                double x = puntosTemporales[0].X + G.Escenario.Centro.X;
                double y = puntosTemporales[0].Y + G.Escenario.Centro.Y;
                G.Pintor.dibujarPunto(new Punto(x, y));
            }
            else
            {
                Punto    aF  = new Punto(puntosTemporales[nPuntos - 1].X + G.Escenario.Centro.X, puntosTemporales[nPuntos - 1].Y + G.Escenario.Centro.Y);
                Punto    aI  = new Punto(puntosTemporales[nPuntos - 2].X + G.Escenario.Centro.X, puntosTemporales[nPuntos - 2].Y + G.Escenario.Centro.Y);
                Poligono pol = new Poligono(aF, Poligono.TipoPoligono.Abierto);
                pol.Add(aI);
                G.Pintor.dibujarPoligono(pol);//poligono absoluto dibujando temporales
            }
        }