The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Tk::CanvasFig - additional Tk::Canvas methods for dealing with figs

SYNOPSIS

    use Tk::CanvasFig;
    $canvas->fig(-file => $filename, -imagedir => $filename."-images");

DESCRIPTION

This module adds another method to the Tk::Canvas namespace: fig. The fig method creates a xfig compatible file from the given canvas. The output is written to a file if the -file option is specified, otherwise it is returned as a string. The creation of images is only supported if the -imagedir option is specified.

ARGUMENTS

-file

The file name for the FIG output. If this option is not specified, then the result will be returned as a string.

-imagedir

If images are included in the canvas, then they will be written into the directory specified by this option. The directory has to exist. If this option is not specified, no images are created.

-imagetype

The image type for the images created in -imagedir. By default, xpm is used, but every Tk-supported and xfig-supported image type can be used. Note that a plain xfig build does not have xpm support. Also note that xfig uses external programs for decoding other file formats like gif or ppm, so this can be *very* slow if you have a lot of images in the canvas. If netpbm with ppmtopcx is installed, the image type pcx can be used, for which xfig does not need an external program. See also "BUGS".

BUGS

Not all canvas items are implemented (grid, groups).

Not everything is perfect.

xfig 3.2.3d dumps core if xpm images with more than 256 colors are used. If you have such images, you have to use another -imagetype.

Transparency will only be handled in xpm images correctly. This is because netpbm programs does not handle transparency.

SEE ALSO

Tk, Tk::Canvas, xfig(1)

AUTHOR

Slaven Rezic <slaven@rezic.de>

COPYRIGHT

Copyright (c) 1998, 2001, 2002, 2009 Slaven Rezic. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.