use strict;
use warnings;
use Image::Magick;

# Fontauswahl bei Linux/Unix
# my $font = '-adobe-helvetica-medium-r-normal--25-180-100-100-p-130-iso8729-1';
# my $font = "Times";

# Fontauswahl bei Windows
# my $font = 'C:\\windows\\fonts\\times.ttf';
# my $font = 'C:/windows/fonts/comic.ttf';

# Oder den Demo-Font von PerlMagick
my $font = 'Generic.ttf';

my $image=Image::Magick->new(size=>"600x600",pointsize=>24,font=>$font);

# Leeres Bild mit weißem Hintergrund
$image->Read("xc:white");

# Achsenkreuz zeichnen
$image->Draw(primitive=>'line',points=>"300,100 300,500",stroke=>'#600');
$image->Draw(primitive=>'line',points=>"100,300 500,300",stroke=>'#600');
$image->Draw(primitive=>'rectangle',points=>"100,100 500,500",fill=>'none', stroke=>'#600');

# Text in jeder Himmelsrichtung schreiben
$image->Annotate(text=>"North West",gravity=>"NorthWest",x=>100,y=>100);
$image->Annotate(text=>"North",gravity=>"North",x=>0,y=>100);
$image->Annotate(text=>"North East",gravity=>"NorthEast",x=>100,y=>100);
$image->Annotate(text=>"West",gravity=>"West",x=>100,y=>0);
$image->Annotate(text=>"Center",gravity=>"Center");
$image->Annotate(text=>"East",gravity=>"East",x=>100,y=>0);
$image->Annotate(text=>"South West",gravity=>"SouthWest",x=>100,y=>100);
$image->Annotate(text=>"South",gravity=>"South",x=>0,y=>100);
$image->Annotate(text=>"South East",gravity=>"SouthEast",x=>100,y=>100);

# und abspeichern
$image->Write("text.gif");
