Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Bitmap for beginners (Perl Tk)

by mawe (Hermit)
on Feb 16, 2005 at 10:21 UTC ( [id://431505]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Bitmap for beginners (Perl Tk)
in thread Bitmap for beginners (Perl Tk)

Hi!

The data you receive from encode_photo_data() is not a file, so you have to use Photo(-data=>...):

$encoded_pic = encode_photo_data("up.bmp"); my $pic = $top->Photo(-data=>$encoded_pic);
or in one line:
my $pic = $top->Photo(-data=>encode_photo_data("up.bmp"));
Regards, mawe

Replies are listed 'Best First'.
Re^6: Bitmap for beginners (Perl Tk)
by TonyDonker (Novice) on Feb 16, 2005 at 10:46 UTC
    This works also fine:

    use Tk;<br/> my $top = new MainWindow;<br/> my $pic = $top->Photo(-file=>"img/hals.gif");<br/> $top->Button(-image=>$pic)->pack();<br/> MainLoop();<br/><br/>
    a .GIF instead of a .BMP

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found