阅读背景:

c# winfrom 在panel上绘制矩形_燕儿归的专栏_c#winform画矩形

来源:互联网 


Bitmap b = new Bitmap(panel1.Width, panel1.Height);
            Graphics g = Graphics.FromImage(b);
            Rectangle rect = new Rectangle((panel1.Width / 2) - 128, (panel1.Height / 2) - 152, 256, 304);
            g.DrawRectangle(new Pen(Color.Lime, 2), rect);
            g.Dispose();
            panel1.BackgroundImage = b;Bitmap b = new Bitmap(panel1.Width, pane



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: