<HTML><HEAD><TITLE>Tk Library Procedures - Tk_CanvasPsY manual page</TITLE></HEAD><BODY> <H3><A NAME="M2">NAME</A></H3> Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple - utility procedures for generating Postscript for canvases <H3><A NAME="M3">SYNOPSIS</A></H3> <B>#include <tk.h></B><BR> double<BR> <B>Tk_CanvasPsY</B>(<I>canvas, canvasY</I>)<BR> int<BR> <B>Tk_CanvasPsBitmap</B>(<I>interp, canvas, bitmap, x, y, width, height</I>)<BR> int<BR> <B>Tk_CanvasPsColor</B>(<I>interp, canvas, colorPtr</I>)<BR> int<BR> <B>Tk_CanvasPsFont</B>(<I>interp, canvas, fontStructPtr</I>)<BR> <B>Tk_CanvasPsPath</B>(<I>interp, canvas, coordPtr, numPoints</I>)<BR> int<BR> <B>Tk_CanvasPsStipple</B>(<I>interp, canvas, bitmap</I>)<BR> <H3><A NAME="M4">ARGUMENTS</A></H3> <DL> <P><DT>Tk_Canvas <B><A HREF="../TkCmd/canvas.htm">canvas</A></B> (in)<DD> A token that identifies a canvas widget for which Postscript is being generated. <P><DT>double <B>canvasY</B> (in)<DD> Y-coordinate in the space of the canvas. <P><DT><A HREF="../TclLib/Interp.htm">Tcl_Interp</A> <B>*interp</B> (in/out)<DD> A Tcl interpreter; Postscript is appended to its result, or the result may be replaced with an error message. <P><DT>Pixmap <B><A HREF="../TkCmd/bitmap.htm">bitmap</A></B> (in)<DD> Bitmap to use for generating Postscript. <P><DT>int <B>x</B> (in)<DD> X-coordinate within <I>bitmap</I> of left edge of region to output. <P><DT>int <B>y</B> (in)<DD> Y-coordinate within <I>bitmap</I> of top edge of region to output. <P><DT>int <B>width</B> (in)<DD> Width of region of bitmap to output, in pixels. <P><DT>int <B>height</B> (in)<DD> Height of region of bitmap to output, in pixels. <P><DT>XColor <B>*colorPtr</B> (in)<DD> Information about color value to set in Postscript. <P><DT>XFontStruct <B>*fontStructPtr</B> (in)<DD> Font for which Postscript is to be generated. <P><DT>double <B>*coordPtr</B> (in)<DD> Pointer to an array of coordinates for one or more points specified in canvas coordinates. The order of values in <I>coordPtr</I> is x1, y1, x2, y2, x3, y3, and so on. <P><DT>int <B>numPoints</B> (in)<DD> Number of points at <I>coordPtr</I>. <P></DL> <H3><A NAME="M5">DESCRIPTION</A></H3> These procedures are called by canvas type managers to carry out common functions related to generating Postscript. Most of the procedures take a <I>canvas</I> argument, which refers to a canvas widget for which Postscript is being generated. <P> <B>Tk_CanvasY</B> takes as argument a y-coordinate in the space of a canvas and returns the value that should be used for that point in the Postscript currently being generated for <I>canvas</I>. Y coordinates require transformation because Postscript uses an origin at the lower-left corner whereas X uses an origin at the upper-left corner. Canvas x coordinates can be used directly in Postscript without transformation. <P> <B>Tk_CanvasPsBitmap</B> generates Postscript to describe a region of a bitmap. The Postscript is generated in proper image data format for Postscript, i.e., as data between angle brackets, one bit per pixel. The Postscript is appended to <I>interp->result</I> and TCL_OK is returned unless an error occurs, in which case TCL_ERROR is returned and <I>interp->result</I> is overwritten with an error message. <P> <B>Tk_CanvasPsColor</B> generates Postscript to set the current color to correspond to its <I>colorPtr</I> argument, taking into account any color map specified in the <B>postscript</B> command. It appends the Postscript to <I>interp->result</I> and returns TCL_OK unless an error occurs, in which case TCL_ERROR is returned and <I>interp->result</I> is overwritten with an error message. <P> <B>Tk_CanvasPsFont</B> generates Postscript that sets the current font to match <I>fontStructPtr</I> as closely as possible. <B>Tk_CanvasPsFont</B> takes into account any font map specified in the <B>postscript</B> command, and it does the best it can at mapping X fonts to Postscript fonts. It appends the Postscript to <I>interp->result</I> and returns TCL_OK unless an error occurs, in which case TCL_ERROR is returned and <I>interp->result</I> is overwritten with an error message. <P> <B>Tk_CanvasPsPath</B> generates Postscript to set the current path to the set of points given by <I>coordPtr</I> and <I>numPoints</I>. It appends the resulting Postscript to <I>interp->result</I>. <P> <B>Tk_CanvasPsStipple</B> generates Postscript that will fill the current path in stippled fashion. It uses <I>bitmap</I> as the stipple pattern and the current Postscript color; ones in the stipple bitmap are drawn in the current color, and zeroes are not drawn at all. The Postscript is appended to <I>interp->result</I> and TCL_OK is returned, unless an error occurs, in which case TCL_ERROR is returned and <I>interp->result</I> is overwritten with an error message. <H3><A NAME="M6">KEYWORDS</A></H3> <A href="../Keywords/B.htm#bitmap">bitmap</A>, <A href="../Keywords/C.htm#canvas">canvas</A>, <A href="../Keywords/C.htm#color">color</A>, <A href="../Keywords/F.htm#font">font</A>, <A href="../Keywords/P.htm#path">path</A>, <A href="../Keywords/P.htm#Postscript">Postscript</A>, <A href="../Keywords/S.htm#stipple">stipple</A> <HR><PRE> <A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc. <A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE> </BODY></HTML>