1 #!/usr/bin/perl 2 3 use Image::Magick; 4 5 #$font = '-adobe-helvetica-medium-r-normal--25-180-100-100-p-130-iso8729-1'; 6 #$font = 'Times'; 7 $font = 'Generic.ttf'; 8 9 $image = Image::Magick->new(); 10 $x = 100; 11 $y = 100; 12 for ($angle=0; $angle < 360; $angle+=30) 13 { 14 my ($label); 15 16 print "angle $angle\n"; 17 $label=Image::Magick->new(size=>"600x600",pointsize=>24,font=>$font); 18 $label->Read("xc:white"); 19 $label->Draw(primitive=>'line',points=>"300,100 300,500",stroke=>'#600'); 20 $label->Draw(primitive=>'line',points=>"100,300 500,300",stroke=>'#600'); 21 $label->Draw(primitive=>'rectangle',points=>"100,100 500,500",fill=>'none', 22 stroke=>'#600'); 23 $label->Annotate(text=>"North West",gravity=>"NorthWest",x=>$x,y=>$y, 24 undercolor=>'yellow',rotate=>$angle); 25 $label->Annotate(text=>"North",gravity=>"North",y=>$y,rotate=>$angle); 26 $label->Annotate(text=>"North East",gravity=>"NorthEast",x=>$x,y=>$y, 27 rotate=>$angle); 28 $label->Annotate(text=>"West",gravity=>"West",x=>$x,rotate=>$angle); 29 $label->Annotate(text=>"Center",gravity=>"Center",rotate=>$angle); 30 $label->Annotate(text=>"East",gravity=>"East",x=>$x,rotate=>$angle); 31 $label->Annotate(text=>"South West",gravity=>"SouthWest",x=>$x,y=>$y, 32 rotate=>$angle); 33 $label->Annotate(text=>"South",gravity=>"South",y=>$y,rotate=>$angle); 34 $label->Annotate(text=>"South East",gravity=>"SouthEast",x=>$x,y=>$y, 35 rotate=>$angle); 36 push(@$image,$label); 37 } 38 $image->Set(delay=>20); 39 $image->Write("annotate.miff"); 40 $image->Animate(); 41