有5个point位置得到了一个旋转的及显示位置的矩形,怎么根据这5个位置画一个旋转及指定位置的图形,对GDI不太熟,忘大神指点迷津!C#GDI+

解决方案 »

  1.   

    private void Form1_Load(object sender, EventArgs e)
    {
        GraphicsPath mypath = new GraphicsPath();
        mypath.AddPolygon(new[] { new Point(0, 0), new Point(0, this.Height), new Point(this.Width, 0) 
    });
        Region myregion = new Region(mypath);
        this.Region = myregion;
    }
    再添加命名空间using System.Drawing.Drawing2D;
    这样就能实现窗体变成三角形的功能了,至于矩形可以类似的写出代码。希望对你有用哈?