private void PictureBox1_Click (object sender, EventArgs e) {Random r = new Random (); string str = NULL; for (int i = 0; i < 6; i++) {int rnumber = r.next (0, 10); str + = Rnumber; }//Create GDI object Bitmap BMP = new Bitmap (120, 25); Graphics g = graphics.fromimage (BMP); for (int i = 0; i < 6; i++) {point P = new Point (i * 15, 0); String[] Fonts = {"Official script", "imitation", "Chinese Xingkai", "Arial", "Microsoft Jas Black"}; color[] Colors = {color.red, color.black, Color.Blue, Color.deeppink, Color.dimgray}; g.DrawString (Str[i]. ToString (), New Font (Fonts[r.next (0, 5), FontStyle.Bold), New SolidBrush (Colors[r.next (0, 5)]), p); } for (int i = 0; i < i++) {point p1=new Point (R.next (0,bmp). Width), R.next (0,bmp. Height)); Point P2=new Point (R.next (0,bmp. Width), R.next (0,bmp. Height)); G.drawline (New Pen (Brushes.green), p1, p2); } for (int i = 0; I <=; i++) {point p1 = new Point (R.next (0, BMP). Width), R.next (0, BMP. Height)); Point P2 = new Point (R.next (0, BMP). Width), R.next (0, BMP. Height)); Bmp. SetPixel (P1. X,p1. Y,color.black); } picturebox1.image = BMP; }
C # Verification Code