# builds a rounded filled rectangle by the coordinates of the left upper ,
# righ down corner , radius and color object
sub AddRoundedRectangleToImg {
my $self = shift ;
my $refObjImg = shift ;
my $objImg = $$refObjImg ;
my $x1 = shift ;
my $y1 = shift ;
my $x2 = shift ;
my $y2 = shift ;
my $radius = shift ;
my $objColor = shift ;
#$objImg ->filledRectangle ( $x1 + 400, $y1, $x2 + 400, $y2, $colorBrown);
$objImg->filledRectangle ( $x1 , $y1+ $radius , $x2 , $y2 - $radius , $objColor);
$objImg->filledRectangle ( $x1 + $radius , $y1 , $x2 - $radius , $y2 , $objColor );
my $diameter = $radius*2;
# build the corners
$objImg ->filledArc( $x1+$radius, $y1+$radius, $diameter, $diameter, 0 , 360 , $objColor);
$objImg ->filledArc( $x1+$radius, $y2-$radius, $diameter, $diameter, 0 , 360 , $objColor);
$objImg ->filledArc( $x2-$radius, $y2-$radius, $diameter, $diameter, 0 , 360 , $objColor);
$objImg ->filledArc( $x2-$radius, $y1+$radius, $diameter, $diameter, 0 , 360 , $objColor);
return \$objImg ;
}
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!