in reply to Re: Re: using an image in binary perl
in thread using an image in binary perl TK
You can use the following code to load the file and generate the Perl code to set the image string, which you can then include in your script:
{ open IN, "tsl_logo1.gif"; binmode IN; local $/; print "\$image = unpack 'u*', <<'_END_';\n"; print pack "u*", <IN>; print "_END_\n"; }
Of course, that requires that you can just set an image in a UI from a binary string, instead of loading it from a file. I don't know what module you're using for the UI, so you'll have to check that yourself.
|
|---|