
use Image::Magick;
my($image, $x);

$text = shift;
chomp $text;
$image = Image::Magick ->new(size => '150x40');

$x = $image -> ReadImage('xc:#336699');
warn "$x" if "$x";

# Right Yellow Box
#$x = $image ->Draw(fill =>'#eeee11', primitive=>'rectangle',
#points => '145,0 150,30');  
#warn "$x" if "$x";

# Left Yellow Box
#$x = $image -> Draw(fill=>'#eeee11', primitive=>'rectangle',
#points=>'0,0 5,30');
#warn "$x" if "$x";

# Bottom Light Blue Box
$x = $image -> Draw(fill=>'#ccffff', primitive=>'rectangle',
points=>'0,25 150,50');
warn "$x" if "$x";

# Black Line
$x = $image -> Draw(fill=>'#000000', primitive=>'rectangle',
points=>'0,38 150,40');

# Ellipse
$x = $image -> Draw(fill=>'#ccffff', primitive=>'ellipse',
points => '75,30 75,28 180,360' );

#($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = 
#    $image->QueryFontMetrics();

# Here we add the text
my( $x ) = $image ->
Annotate(text => $text, 
font =>'usr/X11R6/lib/X11/fonts/myfonts/magik.ttf', 
style=>'Italic',
pointsize =>'24', 
gravity=>('Center'), 
fill =>'#111111');
warn "$x" if "$x";

$x = $image->Raise(geometry=>'-3x-3');


$x = $image->Set(magick =>'jpg');
$x = $image->Write('button_off.jpg');
warn "$x" if "$x";
