Thanks a lot but I'm incapable of building Gtk2. It may be possible but seems not to worth the effort as of yet. I would rather put something to work with the means easily accesible. With Imager suggested by Anonymous Monk I was able to put together this code:
use Imager;
my $icon_width=128;
my $icon_height=128;
my $image = Imager->new(xsize => $icon_width, ysize => $icon_height);
$image->box(
xmin=>0,
ymin=>0,
xmax=>$icon_width-1,
ymax => $icon_height-1,
filled => 1, color => '#ffffff'
);
my $font_filename = 'C:/Windows/Fonts/arialbd.ttf';
my $font = Imager::Font->new(file=>$font_filename) or die "Cannot loa
+d $font_filename: ", Imager->errstr;
print "Enter number: ";my $text=<>;chomp($text);
my $text_size = 96;
$font->align(
string => $text,
size => $text_size,
color => '#000000',
x => $image->getwidth/2,
y => $image->getheight/2,
halign => 'center',
valign => 'center',
image => $image
);
$image->write(file=>'number.ico') or die 'Cannot save image: ', $image
+->errstr;
It is a little bit weird (my be this is not the right font for this) but it works.
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.