home *** CD-ROM | disk | FTP | other *** search
- #!D:\temp\korbes\Perl\bin\perl
- ##
- ## printenv -- demo CGI program which just prints its environment
- ##
- $F = new CGI;
- print $F->header('image/png');
-
- use GD;
-
- $im = new GD::Image(100,100);
-
- # allocate black -- this will be our background
- $black = $im->colorAllocate(0, 0, 0);
-
- # allocate white
- $white = $im->colorAllocate(255, 255, 255);
-
- # allocate red
- $red = $im->colorAllocate(255, 0, 0);
-
- # allocate blue
- $blue = $im->colorAllocate(0,0,255);
-
- # make the background transparent and interlaced
- $im->transparent($white);
- #$im->interlaced('true');
-
- # Put a black frame around the picture
- $im->rectangle(0,0,99,99,$white);
-
- #Inscribe an ellipse in the image
- # $im->arc(50, 25, 98, 48, 0, 360, $white);
- $im->arc(50,50,95,75,0,360,$blue);
-
- # Flood-fill the ellipse. Fill color is red, and will replace the
- # black interior of the ellipse
- $im->fill(50, 50, $red);
-
- binmode STDOUT;
-
- # print the image to stdout
- print $im->png;
-
-
-
-
-