Dear Monks,I used to capture a postscript image (which consisted of a graph with nodes and edges) in Tk::Canvas using a code as below :
my ($miny, $maxy) = (1000000000000000000, -1000000000000000000); my ($minx, $maxx) = (1000000000000000000, -1000000000000000000); ## Stored all node coordinate information in @graph_node for(my $i=0;$i<@graph_node;$i++) { my ($x,$y) = $graph_node[$i]->get_coords; $maxy = $y if $y > $maxy; $miny = $y if $y < $miny; $maxx = $x if $x > $maxx; $minx = $x if $x < $minx; } $maxx = $maxx + 90; $maxy = $maxy + 90; $minx = $minx - 90; $miny = $miny - 90; @capture=('-x'=>$minx,'-y'=>$miny,-height=>$maxy-$miny,-width +=>$maxx-$minx); $scrolled_can->postscript(-colormode=>'color', -file=> "$screenshot_path", -rotate=>0, -width=>2400, -height=>3400, @capture);
I used the above strategy instead of
my ($xt0,$yt0,$xt1,$yt1) = $_canvas{0}->bbox('all');
because sometimes the bbox capture did not capture the canvas properly .

Now when I started working with Tk::Abstract Canvas, this capture does not work properly (both the methods). It mostly captures some partial areas of the AbstractCanvas and not the full.

Is it possible to solve this problem in AbstractCanvas. It would also be great if you can help me getting some other way to capture the canvas in a .jpeg or .tiff or .svg or some format that is more often used (in windows). Presently I am working with Linux but I need to make my code work for windows as well with the capture image of the whole canvas.

Any help would be highly appreciated...Thanks

In reply to Problem with postscript capturing of Tk::AbstractCanvas by KuntalBhusan

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.