Re: Get Tk::Canvas pixels
"John" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <003401c4d60a$b685de20$747882c3@jonsof> |
Let's assume the code below
--------------------------------------------------------
use Tk;
use Tk::Canvas;
my $box = [0, 0, 500, 500];
my $mw = new MainWindow;
my $c = $mw->Scrolled(qw/
Canvas -bg white
-xscrollincrement 1
-yscrollincrement 1
-confine 0
-scrollbars se
-width 500
-height 500/,
-scrollregion => $box,
);
$c->pack(qw/-fill both -expand 1 -side top/);
----------------------------------------------------
How the Tk::Photo be applied to the above canvas instance?
----- Original Message -----
From: <[email protected]>
To: "John" <[email protected]>
Cc: <[email protected]>
Sent: Monday, November 29, 2004 11:51 AM
Subject: Re: Get Tk::Canvas pixels
> "John" <[email protected]> wrote:
> > Is there any finction or method or a way at least,
> > that can read the canvas pixels and write them downto
> > a file?
>
> You can use Tk::WinPhoto to take a snapshot of a canvas widget (or
> any other widget). You get a Tk::Photo object which can be saved
> as a normal image file (gif, png ...) or inspected through the data()
> method.
>
> Regards,
> Slaven
>
> --
> __o Slaven Rezic
> _`\<,_ slaven <at> rezic <dot> de
> __(_)/ (_)____
>
____________________________________________________________________________
__
>
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]