Captcha image - ASP.NET

I am doing my own Captcha checkout on my website. Everything works, except that I need a blurry / effect on my text that is not visible by a web browser, etc.

Some of the code used to generate text on the image:

Bitmap BitMap = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg");
Graphics g = Graphics.FromImage(BitMap);
g.DrawString(""+RandomNumberString+"", new Font("Tahoma", 40), Brushes.Khaki, new PointF(1, 1));
pictureBox1.Image = BitMap;

Example:

enter image description here

What can I do to get my effects / blur in my text?

Thank!

+5
source share
3 answers

Take a look at this tutorial . There you will find sample code on how to create a CAPTCHA using C # and a method DrawString.

Hope this helps.

0
source

, reCAPTCHA , ( , ) ? .NET .

Edit:

, , "" ASP.NET Framework ", . ImageHipChallenge, .

:

for (int y = 0; y < height; y++)
{
    for (int x = 0; x < width; x++)
    {
        int newX = (int)(x + (distortion * Math.Sin(Math.PI * y / 64.0)));
        int newY = (int)(y + (distortion * Math.Cos(Math.PI * x / 64.0)));
        if (newX < 0 || newX >= width) newX = 0;
        if (newY < 0 || newY >= height) newY = 0;
        b.SetPixel(x, y, copy.GetPixel(newX, newY));
    }
}

. , .

+2

All Articles