Thanks for everyone's help on my
previous Image::Magic related question. However, now that I got the fonts resolved, I am now having difficulties with creating a semi-transparent background in which I could draw my text. I have search
here but did not find the answer. Similarly, the
available documentation is not very helpful. My code so far is this
use strict;
use Image::Magick;
my ($image, $x);
$image = Image::Magick->new;
$x = $image->Set(size=>'100x100'); warn "$x" if $x;
$x = $image->ReadImage('xc:none'); warn "$x" if $x;
$x = $image->Draw(primitive=>'rectangle', points=>'5,5,50,25', fill=>'
+white'); warn "$x" if $x;
#$image->MatteFloodfill(x=>6, y=>6, matte => 90); <== gives 'Unrecogn
+ized option (matte)' error
$x = $image->Annotate(font=>'/usr/share/fonts/bitstream/Vera.ttf', fil
+l=>'#00FF00', pointsize=>12, x=>10, y=>20, text=>'Hi'); warn "$x" if
+$x;
$x = $image->Write('x.png'); warn "$x" if $x;
undef $image;
What I now want is to figure out a way to make the rectangle semi-transparent. Please help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.