fills.pl
上传用户:qdrechuli
上传日期:2022-08-01
资源大小:917k
文件大小:1k
- #!/usr/local/bin/perl
- use GD;
- $im = new GD::Image(100,50);
- # 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);
- #Inscribe an ellipse in the image
- $im->arc(50, 25, 98, 48, 0, 360, $white);
- # Flood-fill the ellipse. Fill color is red, and will replace the
- # black interior of the ellipse
- $im->fill(50, 21, $red);
- # print the image to stdout
- print $im->gif;