Changing background and color

Mar 11, 2013 at 6:15 PM
Newbie here. Do you have any examples of ways to change the background color and font color on the captcha image?

Thanks in advance for any help or direction.
Coordinator
Mar 14, 2013 at 4:51 PM
Hi there,
To change some settings in the rendering captcha, you can use this code:
/// <summary>
/// Starts the application.
/// </summary>
public void Application_Start()
{
    var imageGenerator = CaptchaUtils.ImageGenerator;
    //Change Background
    //imageGenerator.Background
    //Change FontColor
    //imageGenerator.FontColor
    //Change width
    //imageGenerator.Width
    //Change height
    //imageGenerator.Height
    //Change font names
    //imageGenerator.Fonts
Or you can implement the CaptchaMvc.Interface.IImageGenerator interface and render captcha as you want.
/// <summary>
/// Starts the application.
/// </summary>
public void Application_Start()
{
         CaptchaUtils.ImageGenerator = new MyImageGenerator();
Regards,
Vyacheslav Volkov
Jul 17, 2014 at 4:14 AM
Hi Vyacheslav Volkov

What is value of : imageGenerator.Background

Thanks
Coordinator
Jul 17, 2014 at 6:28 AM
Hi there,
This property allows you to change the background of the generated image, default value is Color.White.
This code changes it to Gray:
CaptchaUtils.ImageGenerator.Background = Color.Gray;
Regards,
Vyacheslav Volkov
Jul 17, 2014 at 8:07 AM
oh, Thanks very much!!