On 5/8/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 5/8/07, Somu <[EMAIL PROTECTED]> wrote:
> Thank you so much.. I was doing
>  $pic=$mw->Photo(args...)->pack;
>  by the way, how do i get the data for any picture as Zentara did?
> And, please Mr. Chas, can u explain me your example in the other
> string? I dont know what XPM is and i couldn't follow your code from
>  static char ...

I will have to look for Zentara's email.

XPM is a file format.  It was originally created to allow C programs
to embed images inside  the source code.  That is why the string looks
like code.  I would suggest looking XPM up in wikipedia* if you wish
to know more.

* http://en.wikipedia.org/wiki/XPM_%28image_format%29


Ah, Zentara was using the base64* method of creating a Tk::Photo.
Base64 is an encoding for a binary file that lets it be used/sent in
places where only ASCII characters are available (i.e. email
attachments).  On most UNIX boxes creating a base64 encoding of a file
is as easy as saying "uuencode -m file".  On XP I am not certain what
the best way is, but, hey, we have Perl so we don't need any stinking
utilities.  Simply install MIME::Base64* and you can convert foo.jpg
into a base64 encoded string by saying:

perl -MMIME::Base64 -e '$/=undef; print MIME::Base64::encode(<>),"\n"' foo.jpg

* http://en.wikipedia.org/wiki/Base64
* http://search.cpan.org/~gaas/MIME-Base64-3.07/Base64.pm

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to