NOTE:
the Tk engine seems to use encapsulated postscript (edit --forimages).. (which might
i quickly add -- works perfectly and with ghostview displays the image)
PART1:
% set filename "file122.png"
% set img [image create photo img -file $filename]
% canvas .con
% .con create image 0 0 -anchor nw -image $img
% pack .con
% set fd [open file2.ps "rw"]
illegal access mode "rw"
% set fd [open file2.ps ]
couldn't open "file2.ps": no such file or directory
% set fd [open "file2.ps" a]
file6
% puts $fd $b
% close $fd
# ghostview file2.ps
yyy shows the image...
PART 2:
%------------------------ sample non encapsulated postscript ------------------ ----------------
% postscript pentagram use ghostview-----------
128 128 moveto
256 0 rlineto 72 rotate
256 0 rlineto 72 rotate
256 0 rlineto 72 rotate
256 0 rlineto 72 rotate
256 0 rlineto 72 rotate
stroke
%=======
PART3:
drawing a line on a canvas:
% canvas .myCanvas -background red -width 100 -height 100
.myCanvas
% pack .myCanvas
% .myCanvas create line 10 10 50 50 30 100 -arrow both -fill yellow
2
% .myCanvas postscript
.
.
.
%%Page: 1 1
save
306.0 396.0 translate
0.5408 0.5408 scale
-51 -51 translate
0 102 moveto 102 102 lineto 102 0 lineto 0 0 lineto closepath clip newpath gsave
13.4347495785238 88.5652504214762 moveto
37.8237716096484 64.1762283903516 43.9407382802766 36.8518457006916 31.8040188596896 6.51004714922395 curveto
0 setlinecap
1 setlinejoin
1 setlinewidth
[] 0 setdash
1.000 1.000 0.000 setrgbcolor AdjustColor
stroke
10 92 moveto
14.5961940777126 82.4526442404192 lineto
15.5059807680758 85.7869124507377 lineto
16.2130875492623 86.4940192319242 lineto
19.5473557595808 87.4038059222874 lineto
10 92 lineto
fill
30 2 moveto
36.9648750490067 9.98545662762776 lineto
33.5418164598207 9.50824994776821 lineto
32.6133397689355 9.87964062412232 lineto
30.4636812594281 12.5859341434592 lineto
30 2 lineto
fill
grestore
restore showpage
%%Trailer
end
%%EOF
---- along with loads of functions....
PAT4 & CONCLUSION:
so yeah... it is very dooable...
Kind Regards/c:20211510~2am
On Thursday, October 14, 2021 at 11:09:30 PM UTC, Conor Williams wrote:
you are talking about floating parts in from Postscript
and making them appear on the canvas for editing etc...
a reverse of:
% canvas .can123
% .can123 postscript
interesting...interesting... I will make a start on it in 1 month... (after looking around for an equivalent...)
my friend... thanks
/c:202115102308:03
On Saturday, November 7, 2020 at 9:16:55 PM UTC, pd wrote:
Hello,
I'd like to know if there's some kind of flexbox engine in pure tcl or as a C/C++ library.
What I'm looking for is a way to draw html elements in a tcl canvas, but I'm not really interested in parsing html because I don't care about html elements.
I'm only interested in an easy way to paint in a canvas, so I think the CSS flexbox model, also known as the box model, should be a great way to paint in a canvas, this will make a canvas just a CSS render engine. It should handle basic box types
like div or span and maybe some basic text ones.
Defining a canvas screen as an html layout should be easy and I suppose it should be render engine available since html is in common use today. But a canvas able to read and paint SVG is also a great solution to the same problem.
I know actual canvas could generate a postscript representation of the canvas by using "postscript" command but I cannot find an import-postcript command or something like that.
I think something like:
canvas html read html-file-or-string ; to write canvas content from html canvas html write html-file-or-sring ; to write canvas content to html
should be great (same for svg just replacling html for svg)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)