Ejemplo n.º 1
0
        /// <summary>
        /// 在PictureBox中绘制砂轮组
        /// </summary>
        /// <param name="pb">图片控件</param>
        public void Draw(PictureBox pb)
        {
            Graphics g  = pb.CreateGraphics();
            Point    p0 = new Point(pb.Width / 3, pb.Height / 2);
            Pen      p  = new Pen(Color.Red, 1f);

            p.DashStyle = DashStyle.DashDot;
            CDraw.SetCoordinate(g, p0, 1f);
            CDraw.DrawAxisXY(g, p);

            for (int i = 0; i < wheels.Length; i++)
            {
                if (wheels[i] == null)
                {
                    break;
                }

                if (i > 0)
                {
                    wheels[i].StartPos = wheels[i - 1].EndPos;
                }
                wheels[i].Draw(g, p0);
            }
        }