Gregwar / Captcha

PHP Captcha library
MIT License
1.73k stars 290 forks source link

setBackgroundColor(r,g,b) 不生效 #40

Closed zongmi closed 10 months ago

zongmi commented 7 years ago
    $builder = new CaptchaBuilder();
    $builder->build(215,80);

    $builder->setBackgroundColor(0,0,0);

    $builder->setIgnoreAllEffects(false);
    $code=$builder->getPhrase();
    header("Cache-Control: no-cache, must-revalidate");
    header('Content-Type: image/jpeg');
    $builder->output();
zongmi commented 7 years ago

e 我的问题

$builder->setBackgroundColor(0,0,0);

$builder->build(215,80);
Gregwar commented 7 years ago

Can you explain your problem in english please? I don't understand what you mean Thanks you

alukaa commented 7 years ago

@Gregwar zongmi's problem is $builder->setBackgroundColor(0,0,0); not working. @zongmi you need call $builder->setBackgroundColor(0,0,0) before $builder->build(215,80) because build means this image is builded,after the image is builded,change the backgroundcolor make no sence(必须在build之前setColor,图片都build出来了再set没有意义)