in reply to Re^2: Bitmap for beginners (Perl Tk)
in thread Bitmap for beginners (Perl Tk)
As zentara mentions below, you have to base64 encode the image first. Here is a snippet from Matering Perl/Tk which shows one was to do it:
sub encode_photo_data { my($file) = @_; use MIME::Base64; my ($bin, $data, $stat); open PHOTO, $file or die "Cannot open $file: $!"; while ( $stat = sysread PHOTO, $bin, 57 * 17 ) { $data .= encode_base64($bin); } close PHOTO or die $!; die "sysread error: $!" unless defined $stat; $data; } # end encode_photo_data
Regards, mawe
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Bitmap for beginners (Perl Tk)
by TonyDonker (Novice) on Feb 16, 2005 at 09:00 UTC | |
|
Re^4: Bitmap for beginners (Perl Tk)
by TonyDonker (Novice) on Feb 16, 2005 at 09:47 UTC | |
by mawe (Hermit) on Feb 16, 2005 at 10:21 UTC | |
by TonyDonker (Novice) on Feb 16, 2005 at 10:46 UTC |