Exemple #1
0
        private void PlotMP()
        {
            for (int y = 0; y < mm; y++)
            {
                double mx  = m[y].x + Pb.Width / 2;
                double my  = m[y].y + Pb.Height / 2;
                int    mxi = Convert.ToInt32(mx + 0.5);
                int    myi = Convert.ToInt32(my + 0.5);


                SolidBrush myBrush = new SolidBrush(Color.Red);
                SolidBrush CBrush  = new SolidBrush(Color.White);

                Graphics g = Pb.CreateGraphics();

                Rectangle rect = new Rectangle(pmxi[y] - Convert.ToInt16(m[y].strength) / 2, pmyi[y] - Convert.ToInt16(m[y].strength) / 2, Convert.ToInt16(m[y].strength * 4), Convert.ToInt16(m[y].strength * 4));

                //g.DrawEllipse(CPen, pmxi, pmyi, 4, 4);
                //g.DrawEllipse(CPen, pmxi1, pmyi1, 4, 4);
                g.FillEllipse(CBrush, rect);

                rect = new Rectangle(mxi - Convert.ToInt16(m[y].strength) / 2, myi - Convert.ToInt16(m[y].strength) / 2, Convert.ToInt16(m[y].strength * 4), Convert.ToInt16(m[y].strength * 4));
                //g.DrawEllipse(myPen, mxi, myi, 4, 4);
                //g.DrawEllipse(myPen, mxi1, myi1, 4, 4);

                g.FillEllipse(myBrush, rect);

                pmxi[y] = mxi;
                pmyi[y] = myi;
                g.Dispose();
                myBrush.Dispose();
                CBrush.Dispose();
            }
        }
Exemple #2
0
        private void Plot()
        {
            Pen      ClearPen = new Pen(Color.White);
            Pen      myPen    = new Pen(Color.Blue, 1);
            Graphics g        = Pb.CreateGraphics();

            for (int x = 0; x < cc; x++)
            {
                double px  = c[x].x + Pb.Width / 2;
                double py  = c[x].y + Pb.Height / 2;
                int    pxi = Convert.ToInt32(px + 0.5);
                int    pyi = Convert.ToInt32(py + 0.5);
                g.DrawEllipse(ClearPen, opxi[x], opyi[x], Convert.ToInt16(c[x].strength) * 3, Convert.ToInt16(c[x].strength) * 3);
                g.DrawEllipse(myPen, pxi, pyi, Convert.ToInt16(c[x].strength) * 3, Convert.ToInt16(c[x].strength) * 3);
                opxi[x] = pxi;
                opyi[x] = pyi;
            }
            g.Dispose();
            myPen.Dispose();
            ClearPen.Dispose();
        }