Exemple #1
0
        public void DrawPolygon(Brush brush, Pen pen, int[] pts)
        {
            VerifyAccess();

            brush.RenderPolygon(_bitmap, pen, pts);

            int nPts = pts.Length / 2;

            for (int i = 0; i < nPts - 1; i++)
            {
                DrawLine(pen, pts[i * 2], pts[i * 2 + 1], pts[i * 2 + 2], pts[i * 2 + 3]);
            }

            if (nPts > 2)
            {
                DrawLine(pen, pts[nPts * 2 - 2], pts[nPts * 2 - 1], pts[0], pts[1]);
            }
        }
        public void DrawPolygon(Brush brush, Pen pen, int[] pts)
        {
            VerifyAccess();

            brush.RenderPolygon(_bitmap, pen, pts);

            int nPts = pts.Length / 2;

            for (int i = 0; i < nPts - 1; i++)
            {
                DrawLine(pen, pts[i * 2], pts[i * 2 + 1], pts[i * 2 + 2], pts[i * 2 + 3]);
            }

            if (nPts > 2)
            {
                DrawLine(pen, pts[nPts * 2 - 2], pts[nPts * 2 - 1], pts[0], pts[1]);
            }
        }