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