正在加载图片...
以Bitmap.为画板绘制图形 Bitmap image=new Bitmap(100,22); Graphics g Graphics.Fromlmage(image ) 绘制三条随机直线 Random ran new Random(); g.Clear(Color.White);I∥清除背景色,并将背景色显示为白色 for(inti=0;i<3;i++) { int x1 ran.Next(image.Width); int x2 ran.Next(image.Width); inty1=ran.Next(image.Height); int y2 ran.Next(image.Height); g.DrawLine(new Pen(Color.Black),x1,y1,x2,y2); 14 14 以Bitmap为画板绘制图形 Bitmap image = new Bitmap( 100,22); Graphics g = Graphics.FromImage(image ); //绘制三条随机直线 Random ran = new Random(); g.Clear(Color .White ); //清除背景色,并将背景色显示为白色 for (int i = 0; i < 3; i++) { int x1 = ran.Next(image.Width); int x2 = ran.Next(image.Width); int y1 = ran.Next(image.Height); int y2 = ran.Next(image.Height); g.DrawLine(new Pen(Color.Black), x1, y1, x2, y2); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有