#!/usr/bin/perl use strict; use warnings; use Tk; use Image::Magick; my $font = '/usr/share/fonts/truetype/msttcorefonts/impact.ttf'; # my $font = '/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf'; my $mw = new MainWindow; my $image = Image::Magick->new(size => '400x400'); $image->ReadImage('xc:black'); $image->Draw( font => $font, pointsize => 48, fill => 'white', antialias => 'true', primitive =>'text', text => 'Test', points => "50,50" ); $image->Annotate( text => 'Test', geometry => '+50+150', font => $font, fill => 'white', pointsize => 48, ); my $blobs = $image->ImageToBlob(magick => 'gif'); my $bild = $mw->Photo(-data => $blobs, -format => 'gif'); my $label = $mw->Label(-image => $bild)->pack(); my $button = $mw->Button(-text => 'Exit', -command => sub { Tk::exit })->pack; $mw->MainLoop;