Files in directory jni/tkpsvg in any check-in
- generic
- tclconfig
- win
- aclocal.m4
- Android.mk
- camera.svg
- configure
- configure.in
- license.terms
- Makefile.in
- pkgIndex.tcl.in
- README.md
tkpsvg
This package adds support to deal with documents in SVG format from Tcl/Tk similar to the well known tksvg.
The actual code to parse and raster the SVG comes from the packages PlutoSVG and PlutoVG.
Example Tk usage loading SVG into a photo image:
package require tkpsvg
set img [image create photo -file camera.svg]
pack [label .l -image $img]
Package can be used from a tclsh:
package require fileutil
package require tkpsvg
set d [tkpsvg::render [fileutil::cat camera.svg]]
# the result variable "d" is a dict with
# width width in pixels
# height height in pixels
# channels number of channels, RGBA, i.e. 4
# data RGBA byte array
Photo image format "svg" can be registered from tclsh:
package require tkpsvg
tkpsvg::register ;# loads Tk package
chw July 2026