Ejemplo n.º 1
0
        public virtual void  paint(System.Drawing.Graphics g)
        {
            //    Graphics2D g2 = (Graphics2D) g;
            SupportClass.GraphicsManager.Manager.SetColor(g, System.Drawing.Color.DarkGray);
            if (m_bZeichenMode)
            {
                SupportClass.GraphicsManager.Manager.SetColor(g, System.Drawing.Color.Black);
                if (m_iEcken > 1)
                {
                    g.DrawLines(Pens.White, SupportClass.GetPoints(m_EckeX, m_EckeY, m_iEcken));
                }
            }
            else if (!m_bPainted)
            {
                System.Windows.Forms.Cursor temp_Cursor;
                temp_Cursor = new System.Windows.Forms.Cursor(new System.IntPtr(1));
                temp_Cursor = m_Ground.Cursor;
                System.Windows.Forms.Cursor oCursor = temp_Cursor;
                System.Windows.Forms.Cursor temp_Cursor2;
                temp_Cursor2    = System.Windows.Forms.Cursors.WaitCursor;
                m_Ground.Cursor = temp_Cursor2;
                SupportClass.GraphicsManager.Manager.SetColor(g, System.Drawing.Color.Gray);
                int i = 0;
                for (int x1 = 0; x1 < m_iEcken * 2; x1++)
                {
                    for (int x2 = 1; x2 < m_iEcken * 2 - 1; x2++)
                    {
                        for (int x3 = 2; x3 < m_iEcken * 2 - 2; x3++)
                        {
                            if ((x1 != x2) && (x1 != x3) && (x2 != x3))
                            {
                                if (!m_bDelete)
                                {
                                    if (i >= iMaxColors)
                                    {
                                        i = 0;
                                    }

                                    SupportClass.GraphicsManager.Manager.SetColor(g, m_Colors[i]);

                                    /*
                                     * GradientPaint gp = new GradientPaint(new Point(m_EckeX[0],m_EckeY[0]),
                                     * m_Colors[i],new Point(m_EckeX[m_iEcken*2-1],m_EckeY[m_iEcken*2-1]),m_Colors[i+1]);
                                     * g2.setPaint(gp);*/
                                    i++;
                                }
                                int[] xPoints = new int[3];
                                xPoints[0] = m_EckeX[x1];
                                xPoints[1] = m_EckeX[x2];
                                xPoints[2] = m_EckeX[x3];
                                int[] yPoints = new int[3];
                                yPoints[0] = m_EckeY[x1];
                                yPoints[1] = m_EckeY[x2];
                                yPoints[2] = m_EckeY[x3];
                                g.FillPath(SupportClass.GraphicsManager.Manager.GetBrush(g), SupportClass.CreateGraphicsPath(xPoints, yPoints, 3));
                            }
                        }
                    }
                }
                m_bPainted      = true;
                m_Ground.Cursor = oCursor;
            }
        }