Pen Test in c#.net-gdi+

Source: Internet
Author: User

Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.linq;using system.text;using system.threading.tasks;using system.windows.forms;//1366*768namespace        painttest1{public partial class Form1:form {public Form1 () {InitializeComponent (); private void Button1_Click (object sender, EventArgs e) {system.random r = new System.rand            Om ();            Graphics G; g = this.  CreateGraphics ();               /* while (true) {int x1 = r.next (0, 1366);               int y1 = r.next (0, 200);               int x2 = x1;               int y2 = y1 + r.next (0, 400);                   for (int i=y1;i<=y2;i++) {Pen Greenpen = new Pen (Color.green, R.next (1, 15));               G.drawline (Greenpen, x1, y1, x2, y2);        }} */for (int i = 0; i < i++) {            Pen Whitepen = new Pen (Color.FromArgb (R.next (0,255), R.next (0,255), R.next (0,255)), 8);                   int x1 = R.next (100,300);                   int y1 = r.next (100, 500);                   int x2 = r.next (100, 300);                   int y2 = r.next (100, 500);                   int x1 = 500;                   int y1 = 500;                   int x2 = i;                    int y2 = 1000-i * i;                     G.drawline (Whitepen, x1, y1, x2, y2);  } for (int i = 0; i < i++) {Pen Whitepen = new Pen (Color.FromArgb (r.next (0),                255), R.next (0, 255), R.next (0, 255)), 9); int x1 = 500; 650-900 int y1 = 300;                100-500 int x2 = R.next (400, 600);                int y2 = r.next (100, 500);                int x1 = 500;                int y1 = 500;                int x2 = i;                int y2 = 1000-i * i; G.drawlINE (Whitepen, x1, y1, x2, y2);  } for (int i = 0; i < i++) {Pen Whitepen = new Pen (Color.FromArgb (r.next (0),                255), R.next (0, 255), R.next (0, 255)), 10); int x1 = 900; 650-900 int y1 = 100;                100-500 int x2 = R.next (700, 900);                int y2 = r.next (100, 500);                int x1 = 500;                int y1 = 500;                int x2 = i;                int y2 = 1000-i * i;            G.drawline (Whitepen, x1, y1, x2, y2);  } for (int i = 0; i < i++) {Pen Whitepen = new Pen (Color.FromArgb (r.next (0),                255), R.next (0, 255), R.next (0, 255)), 11); int x1 = 1000; 650-900 int y1 = 500;                100-500 int x2 = r.next (1000, 1200);                int y2 = r.next (100, 500);                int x1 = 500;                int y1 = 500; int x2 = i;                int y2 = 1000-i * i;            G.drawline (Whitepen, x1, y1, x2, y2);  } for (int i = 0; i < i++) {Pen Whitepen = new Pen (Color.FromArgb (r.next (0),                255), R.next (0, 255), R.next (0, 255)), 12); int x1 = R.next (100,1200);; 650-900 int y1 = r.next (600, 700);;                100-500 int x2 = r.next (100, 1200);                int y2 = r.next (600, 700);                int x1 = 500;                int y1 = 500;                int x2 = i;                int y2 = 1000-i * i;            G.drawline (Whitepen, x1, y1, x2, y2);  } for (int i = 0; i < i++) {Pen Whitepen = new Pen (Color.FromArgb (r.next (0),                255), R.next (0, 255), R.next (0, 255)), R.next (1,15)); int x1 = r.next (100, 1200);; 650-900 int y1 = r.next (600, 700);; 100-500 int x2 = r.next (100, 1200);                int y2 = r.next (600, 700);                int x1 = 500;                int y1 = 500;                int x2 = i;                int y2 = 1000-i * i;            G.drawline (Whitepen, x1, y1, x2, y2); }          }    }}



< This is a dynamic drawing, the effect is OK, the following will be changed to digital rain mode test, the correlation algorithm is being debugged.

Pen Test in c#.net-gdi+

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.