#!/usr/bin/perl -w use strict; use GD; my (%arcData,$orientation,$white,$black,$red,@insertData,$img); %arcData=(topRight=>'0,25,50,50,270,360', topLeft=>'25,25,50,50,180,270', bottomRight=>'0,0,50,50,0,90', bottomLeft=>'25,0,50,50,90,180'); foreach $orientation (keys(%arcData)) { @insertData=split(/,/,$arcData{$orientation}); $img=new GD::Image(25,25); $white=$img->colorAllocate(255,255,255); $img->transparent($white); $black=$img->colorAllocate(0,0,0); $img->arc(@insertData,$black); $red=$img->colorAllocate(255,0,0); $img->fill(@insertData[0,1],$red); open (IMAGEOUT,">$orientation.gif")||die("can't write to $orientation.gif: $!"); binmode (IMAGEOUT); print IMAGEOUT $$orientation->gif; close (IMAGEOUT); print "wrote $orientation.gif.\n"; }