Help: Writing canvas to file in graphics format 
Author Message
 Help: Writing canvas to file in graphics format

--------------82545B4192AAD944ACDF3B59
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am using the tk8.0 tools to generate pixel-accurate graphical
representations of proposed user interfaces for new products and have
been unable to find a mechanism within tk to write out GIF or BMP or
JPEG file formats. The encapsulated postscript that is supported as a
canvas command is not adequate for this purpose as it munges pixels and
perturbs the canvas image size.

Does anybody know of some hidden capability or extension that is
available to do this?

Thanks!

--
===========================================================
Mike Brant
Value & Handheld Product Line (VHPL) Software Engineering
Design Service & Test Business Unit
Measurement Business Division
Tektronix, Inc.
P.O. Box 500 M/S 38-248
Beaverton, OR 97077

Telephone: (503) 627-6222
FAX: (503) 627-5610
===========================================================

--------------82545B4192AAD944ACDF3B59
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I am using the tk8.0 tools to generate pixel-accurate graphical representations
of proposed user interfaces for new products and have been unable to find
a mechanism within tk to write out GIF&nbsp;or BMP&nbsp;or JPEG&nbsp;file
formats. The encapsulated postscript that is supported as a canvas command
is not adequate for this purpose as it munges pixels and perturbs the canvas
image size.

<P>Does anybody know of some hidden capability or extension that is available
to do this?

<P>Thanks!
<PRE>--&nbsp;
===========================================================
Mike Brant
Value &amp; Handheld Product Line (VHPL) Software Engineering
Design Service &amp; Test Business Unit
Measurement Business Division
Tektronix, Inc.
P.O. Box 500 M/S 38-248
Beaverton, OR 97077

Telephone: (503) 627-6222
FAX: (503) 627-5610
===========================================================</PRE>
&nbsp;</HTML>

--------------82545B4192AAD944ACDF3B59--



Sun, 19 Mar 2000 03:00:00 GMT  
 Help: Writing canvas to file in graphics format

Mike,

There is no way to do this directly in Tk.  But the Tk command:

winfo id .canv

will give you the X window id for the canvas .canv, so in Tcl you can do:

exec xwd -nobrds -id [winfo id .canv] -out foo.xwd

now you have the pixel image in xwd format, and you can probably use
the pbmplus toolkit or some such to convert it to a GIF or JPEG.  You
could even pipe the output of xwd to the appropriate member of the pbm
toolkit to write it out in your favorite format all at one blow.

Jim.

+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===

SunScript

+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===



Sun, 19 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. IMAQ Vision - Writing Image Files: File Format

2. canvas & graphic file

3. Easiest Graphic File format to display

4. Tektronics graphics format file

5. Graphics File Format Converters

6. Problem with ASCII form of the PPM graphic file format in tcl

7. Need to read/write graphics files

8. Writing graphics to file?

9. write file.gif from canvas

10. writing a canvas to a file

11. write canvas widget to file & resize

12. Help with WMF (Windows Metafile Format) and the ST/V Graphics Model

 

 
Powered by phpBB® Forum Software