Alternative Canvases

Summary

canvas has inspired similar features in other graphical toolkits and even in web browsers via the <canvas> tag .

The Tk canvas lacks modern features such as antialiasing, and an alpha channel for transparency/translucency. These might be implemented in future versions of Tk - see Tk 9.0 WishList.

  • antialiasing - (Eh? At least under Aqua it has antialiasing; see CGAntialiasLimit in New Tcl/TkAqua FAQ.)
  • I think this is Mac-only - AFAIK line drawing cannot be anti-aliased on other platforms

This page lists alternatives to the Tk canvas widget for 2D graphics. Some of these are really replacements for Tk itself, others use the feature set of the 3D library OpenGL but in a 2D mode.

Widget Replacements

TkZinc
(zinc) - does transparency and antialiasing but only if built against OpenGL
TkPath
-
zoom-canvas
a pure-Tcl canvas extension. It provides a builtin interactive zoom&panning.
TkImgDip
an image extension to Tcl/Tk for viewing arbitrary 1, 2, or 3 dimensional datasets and images as a pseudocolor (8-bit) image. Can be used with ViewIt.
Enhanced Canvas Element
a zoomable canvas with automatic conversion from "world" coordinate to "screen" and "view" coordinate systems based on snit widget

Tk Replacements

NexTk
ntkWidget
Gnocl
has support for the Gnome canvas. Due to Cairo support, this has full object stacking, aliasing and transparency.

OpenGL-based tools

SPI
3dcanvas
Canvas2½D
uses Tcl3D and claims to be 100% compatible with Tk canvas

gilTclCanvas : The gilTclCanvas is a replacement for the Tk canvas. It works pretty much the same, but has three main differences:

  • the rendering is done with OpenGL, thus it is hardware accelerated on most computers.
  • there are only two item types: text and polygons.
  • items have advanced rendering capabilities: transparency, textures (which can be live video when produced by a gilGrabber), arbitrary planar deformations.

See: 3dcanvas, Pdf canvas, Canvas3d, ClassyTk, DataflowCanvas, slate, pixmix, SlideDraw, Swank Canvas Widget, tkgcv, Paved Widgets, Pad++ , padgraph, XCircuit, POW Image/Plot Display , gcanvas