Beispiel #1
0
 public void DrawRandomWords()
 {
     string[] strs = new string[4];
     for (int i = 0; i < 4; i++)
     {
         strs[i] = Captcha.GetRandomWord();
         float h = Math.Min((_width - 10) / 4, _height - 10);
         int   x = 5 + (_width - 10) / 4 * i;
         DrawRandomWord(strs[i], "Verdana", h,
                        Captcha.GetRandomColor(255, 255, 0, 255, 0, 255, 0, 255),
                        GetRandomPoint(x, x, 5, 5));
     }
     _code = string.Join("", strs);
 }
Beispiel #2
0
        public void CreateCaptcha(string path)
        {
            _captcha.SetBackgroundColor(Captcha.GetRandomColor(255, 255, 255, 255, 255, 255, 255, 255));

            for (int i = 0; i < _captcha.Width / 10; i++)
            {
                _captcha.DrawRandomLine();
            }

            _captcha.DrawRandomWords();

            for (int i = 0; i < _captcha.Width; i++)
            {
                _captcha.DrawRandomPixel();
            }

            _captcha.ImageSave(path);
        }
Beispiel #3
0
 public void SetBackgroundColor()
 {
     SetBackgroundColor(Captcha.GetRandomColor());
 }
Beispiel #4
0
 public void DrawRandomPixel()
 {
     DrawRandomPixel(Captcha.GetRandomColor());
 }
Beispiel #5
0
 public void DrawRandomLine()
 {
     DrawRandomLine(Captcha.GetRandomColor(), GetRandomPoint(), GetRandomPoint());
 }