help to create colored regtanc with black border

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
jan99
Posts: 5
Joined: 2011-06-23T01:01:45-07:00
Authentication code: 8675308

help to create colored regtanc with black border

Post by jan99 » 2013-10-09T05:33:22-07:00

hi !

i try to create images with a colored background and a black border.

my source now is:

Code: Select all

#!/usr/bin/perl
use strict;
use warnings;
use Image::Magick;

my $red = $ARGV[1];
my $green = $ARGV[2];
my $blue = $ARGV[3];
my $name = $ARGV[0] || '' ;

print "red: ".$red."\n";
print "green: ".$green."\n";
print "blue: ".$blue."\n";
print "name: ".$name."\n";
my $warn;

my $DEBUG = 1;

# Dateiname

my $color_hex = sprintf "#%02X%02X%02X",$red,$green,$blue;
warn $color_hex if $DEBUG;

# Objekt für Bilder erzeugen
my $img = Image::Magick->new();

 # Bildgröße setzen
$img->Set(size=>'30x20', fill => 'white');

$img->Draw(primitive=>'rectangle', points=>'10,1 15,20', strokewidth=>1,stroke=>'Black');

 # Bild mit Farbe erzeugen
$img->ReadImage("xc:$color_hex");

$name = $name."_" if ($name ne '');

$warn = $img->Write($name.$red."_".$green."_".$blue.".gif");
die $warn if $warn;
but the result is not my wish! could someone help me?

regards Jan :-)

Post Reply