dealing with canvas copy trouble in tcl

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



dealing with canvas copy trouble in tcl



I created with Plotchart::createLogXYPlot in the canvas.
I'm drawing several Graph in same canvas. (Using several plot in same canvas)
I need this canvas to copy or convert file format type.
But I'm searching about this topic, didn't help for me.


Plotchart::createLogXYPlot



Main trouble is saved file having a clipping img.



Clipboard canvas is not working for me. (can't find tag about plotchart)



I'm trying these ways.



capturing canvas to img file format (clipping trouble)



https://nikit.tcl-lang.org/page/Img#2155d00fdc05c6b6b85fa38ed5cd7dda67fd680886245dd51b6f9bcc0ba05a5c



Snapshot canvas (clipping trouble and spend many time)



https://groups.google.com/forum/#!topic/comp.lang.tcl/Dweb1ExDKhw



Clipboard canvas (didn't work)



https://www.tcl.tk/man/tcl/TkCmd/clipboard.htm



Plotchart using Saveplot (need gs(gost scripts), I will not use it, Saved .ps file is success)



How to save Plotchart canvas other than PostScript without displaying it?



I think, fixing img clipping trouble is easiest way for me.



Canvas convert file format:
canvas convert file format Sample



Using snapshot and convert file format:
using snapshot and convert file format Sample



Original graph:
original graph





@L. Alejandro M. Anything ok ( canvas copy, canvas to img File). And main problem is these ways are occured clipping problem. (error code is none) See above Sample img. #original graph is completed by my code.
– jinsu_kim
Aug 7 at 3:37





1 Answer
1



If you want to save your canvas to image, may be this example help you:



package require Img
pack [canvas .c -height 50 -width 50]
.c create rectangle 0 0 25 25 -fill blue
.c create rectangle 25 25 50 50 -fill green
raise . ;# if there's anything over the window on-screen, it'll be obscured in the image
update idletasks
image create photo theCanvas -format window -data .c
theCanvas write "C:\your\path\here\example.png" -format png


package require Img
pack [canvas .c -height 50 -width 50]
.c create rectangle 0 0 25 25 -fill blue
.c create rectangle 25 25 50 50 -fill green
raise . ;# if there's anything over the window on-screen, it'll be obscured in the image
update idletasks
image create photo theCanvas -format window -data .c
theCanvas write "C:\your\path\here\example.png" -format png



(Note: the line of update isn't in the original)



Credit: Mike Griffiths in tcl wiki



Saludos,






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard