What exactly are you trying to copy from the canvas, a screenshot of it's contents?

I couldn't find the clipboardClear or clipboardAppend methods in perldoc Tk::Canvas, so I think you are thinking about this wrong. Maybe you think it is like Gimp, where you can select rectangular regions and save them as graphics to a clipcoard?

The only thing I've seen used is to capture the entire canvas as postscript, or use Win::Photo to capture as a jpg, or png,etc.

The only one which allows you to select coordinates is postscript, and you might be able to select a region, with a mouse drag, and substitute the values into something like the following code:

$mw->Button( -text => "Save PS", -command => [sub { $canv->update; my @capture=(); my ($x0,$y0,$x1,$y1)=$canv->bbox('all'); @capture=('-x'=>$x0,'-y'=>$y0,-height=>$y1-$y0,-width=>$x1-$x +0); $canv->postscript(-colormode=>'color', -file=>$0.'.ps', -rotate=>0, -width=>2400, -height=>3400, @capture); } ] )->pack;
You need to show us some code of what you are actually trying, because we are just guessing at what you want.

I'm not really a human, but I play one on earth. flash japh

In reply to Re: Tk canvas to clipboard by zentara
in thread Tk canvas to clipboard by ChrisR

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.