Re: Get Tk::Canvas pixels

[email protected]
Newsgroups gmane.comp.lang.perl.tk
Message-ID <OF7137EAD8.CBF96D05-ONC1256F5B.0042F777-C1256F5B.00430765@philips.com>



Try Google -> Tk::WinPhoto or directly

http://www.enstimac.fr/Perl/perl5.8.5/site_perl/5.8.5
/sun4-solaris/Tk/WinPhoto.html

Regards,
Gerhard



|---------+---------------------------->
|         |                            |
|         |                            |
|         |                            |
|         |                            |
|         |                            |
|         |    "John"                  |
|         |    <[email protected]>    |
|         |                            |
|         |    Sent by:                |
|         |    [email protected]|
|         |    .EDU                    |
|         |                            |
|         |    2004-11-29 12:58 PM     |
|         |                            |
|---------+---------------------------->
  >---------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                           |
  |           To:   <[email protected]>                                                                                  |
  |           cc:   (bcc: Gerhard Petrowitsch/STN/SC/PHILIPS)                                                                 |
  |           Subject:    Re: Get Tk::Canvas pixels                                                                           |
  |                                                                                                                           |
  |           Classification:                                                                                                 |
  |                                                                                                                           |
  |                                                                                                                           |
  >---------------------------------------------------------------------------------------------------------------------------|




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]



-++**==--++**==--++**==--++**==--++**==--++**==--++**==
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.