in reply to Problem with Truecolor image
#!/usr/bin/perl use GD; GD::Image->trueColor(1); $im = new GD::Image( 1000, 20 ); $white = $im->colorAllocate(255,255,255); $im->fill(20,1000,$white); $ctr = 0; $x = 0; $y = 10; while ( $ctr < 500 ) { $randomRed = int( rand(256) ) + 0; $randomGreen = int( rand(256) ) + 0; $randomBlue = int( rand(256) ) + 0; $getColor = $im->colorAllocate( $randomRed, $randomGreen, $randomBl +ue ); $im->line( $x, $y + 5, $x, $y - 5, $getColor ); $x++; $ctr++; } print $im->png;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with Truecolor image
by chakkaln (Sexton) on Aug 18, 2005 at 14:41 UTC |