Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting an image as gif/jpeg 1

Status
Not open for further replies.

carlosjjang

Programmer
May 19, 2004
2
0
0
CA
I currently have a tcl/tk script that will dynamically generate an image from a text file of coordinates. I've implemented it in a GUI.
However, I now need to export this image as a GIF or JPEG. I was wondering whether this was possible?
 
from the help file on 8.4.5.0:
imageName write filename ?option value(s) ...?
Writes image data from imageName to a file named filename. The following options may be specified:
-background color
If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color.
-format format-name
Specifies the name of the image file format handler to be used to write the data to the file. Specifically, this subcommand searches for the first handler whose name matches a initial substring of format-name and which has the capability to write an image file. If this option is not given, this subcommand uses the first handler that has the capability to write an image file.
-from x1 y1 x2 y2
Specifies a rectangular region of imageName to be written to the image file. If only x1 and y1 are specified, the region extends from (x1,y1) to the bottom-right corner of imageName. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region. The default, if this option is not given, is the whole image.
-grayscale
If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale.

Is that what you want?

Bob Rashkin
rrashkin@csc.com
 
Thanks, that looks like it.
Which help file is it under?
 
On Windows, at least, when I install ActiveState Tcl, I get the help files. IMHO, they're superb.

Bob Rashkin
rrashkin@csc.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top