I am faced with a Problem related perl GD. I am generating random colors and using it to draws lines and polygons in a loop. What I observed was after certain number of cycles, the line color allocated is not changing. I tried to print the output of RGB which appears to be all different. I was wondering whether there is any limit in size in using the colorAllocate method (if so how can I handle the issue)or is there any thing wrong in the way I am implicating it. The following code would reproduce the problem. Thanks for your attention. Please note that I am new to GD. Nagesh
#!/usr/local/bin/perl use GD; $im = new GD::Image(1000,20); $ctr =0; $x=0; $y=10; while ($ctr <1000) { $randomRed=int(rand(256))+0; $randomGreen=int(rand(256))+0; $randomBlue=int(rand(256))+0; $getColor=$im->colorAllocate($randomRed,$randomGreen,$randomBlue); $im->line($x,$y+5,$x,$y-5,$getColor); $x++; $ctr++ } print $im->png;
In reply to Perl GD problem by chakkaln
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |