Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 18th, 2007, 01:30 AM
Registered User
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Jcaptcha image


I am trying to change the background color of the image. But it is working sometimes, remaining times getting defult image with funky background color.

Does anyone face this problem and how to fix this?

Thanks in advance.



public static ImageCaptchaService makeImage(){

        SimpleListImageCaptchaEngine engine = new SimpleListImageCaptchaEngine();

        UniColorBackgroundGenerator bgGen = new UniColorBackgroundGenerator(new Integer(200), new Integer(100), Color.WHITE);
        RandomTextPaster txtPstr = new RandomTextPaster(new Integer(5), new Integer(5), Color.BLACK);
        System.out.println("engine..." + engine.addFactory(new GimpyFactory(new RandomWordGenerator("0123456789"),
            new ComposedWordToImage(new RandomFontGenerator(new Integer(16), new Integer(20)),
            bgGen, txtPstr))));

        System.out.println("ImageCaptchaService....makeIma ge..." );

        return new DefaultManageableImageCaptchaService(new FastHashMapCaptchaStore(), engine, 180, 100000, 75000);


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Copy kodak image edit control's image to clipboard vishwanathduddilla Visual Studio 2005 0 November 3rd, 2008 10:10 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
jcaptcha yoga2007 J2EE 0 January 23rd, 2007 12:45 AM
Problem with jcaptcha harish80 Servlets 0 October 19th, 2006 01:48 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.