After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.
This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.
The source tarball can be downloaded from https://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gz or the repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"
The tcl.gd webpage can be viewed at: http://lehenbauer.github.com/tcl.gd/
The github project for tcl.gd is at https://github.com/lehenbauer/tcl.gd
Thanks, and enjoy tcl.gd.
Karl Lehenbauer
FlightAware
Is it also possible to "dump" a regular canvas widget into a JPEG or
whatever file?
(Of course I can use the Img package for at least a few of these
formats, but that
is basically a screendump.) Or maybe use the canvas widget's commands
and instead
of drawing on an actual window, you draw in a JPEG file.
Merely thinking out loud: such facilities would make it possible to
use existing
code to create JPEG files in, say, a web server application ... No
need for an
actual display.
Regards,
Arjen
> On 19 jan, 20:24, Karl Lehenbauer <karllehenba...@gmail.com> wrote:
>> I am pleased to announce the release of tcl.gd version 1.1, a modern Tcl interface to the GD drawing library that is nearly 100% feature complete with GD, far more complete with gd 2 than Gdtclft.
>>
>> After package requiring the tclgd package, you use the GD command with a suboption to create an image object. You can create an indexed or truecolor image, either starting with an empty one or loading one from a JPEG, PNG, GIF, WBMP, XBM, XPM, GD or GD2 native formats, depending on build options.
>>
>> This create a new command object that you use to manipulate and save your image. You can draw pixels, lines, polygons, rectangles, arcs, and ellipses. You can emit text styled with truetype fonts. You can fill, manage colors, anti-alias, resize, resample, rotate, and merge images, and you can save images as JPEG, GIF, animated GIF, PNG8, PNG24, etc.
>>
>> The source tarball can be downloaded fromhttps://github.com/downloads/lehenbauer/tcl.gd/tcl.gd-1.1.tar.gzor the repository can be cloned with "git clone git://github.com/lehenbauer/tcl.gd.git"
>>
>> The tcl.gd webpage can be viewed at:http://lehenbauer.github.com/tcl.gd/
>> The github project for tcl.gd is athttps://github.com/lehenbauer/tcl.gd
>>
>> Thanks, and enjoy tcl.gd.
>>
>> Karl Lehenbauer
>> FlightAware
>
> Is it also possible to "dump" a regular canvas widget into a JPEG or
> whatever file?
> (Of course I can use the Img package for at least a few of these
> formats, but that
> is basically a screendump.) Or maybe use the canvas widget's commands
> and instead
> of drawing on an actual window, you draw in a JPEG file.
Note
canvas::snap in Tklib
http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_snap.html
http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_mvg.html
The wiki should also have code for dumping a canvas to SVG format.
> Merely thinking out loud: such facilities would make it possible to
> use existing
> code to create JPEG files in, say, a web server application ... No
> need for an
> actual display.
>
> Regards,
>
> Arjen
--
So long,
Andreas Kupries <akup...@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
but if canvas::snap required Tk which means that it requires a display
and this is not good for web server environment. For example We use
TGDChart (tcl package for http://www.fred.net/brv/chart/) to create
graphs and it works with no Tk which is great. Shame it is a bit dead
project now...
>> Note
>> canvas::snap in Tklib
>>
>> http://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_snap.htmlhttp://docs.activestate.com/activetcl/8.5/tklib/canvas/canvas_mvg.html
>>
>> The wiki should also have code for dumping a canvas to SVG format.
> but if canvas::snap required Tk
It does.
> which means that it requires a display
> and this is not good for web server environment.
Point.
> For example We use
> TGDChart (tcl package for http://www.fred.net/brv/chart/) to create
> graphs and it works with no Tk which is great. Shame it is a bit dead
> project now...
--
So long,
Andreas Kupries <akup...@shaw.ca>
tcl.gd does not require any X-Windows but its APIs are tailored toward GD. Even the coordinate system is different from Tk's.
It is possible to use Xvfb to run X-Windows programs headless. ImageMagick's "import" command can be used to grab images from the frame buffer, by window, screen or area. You can run multiple instances of Xvfb and control which one programs draw to as well.