summaryrefslogtreecommitdiffstats
path: root/doc/GetPixels.3
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1998-04-01 09:37:39 (GMT)
committerrjohnson <rjohnson>1998-04-01 09:37:39 (GMT)
commit13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22 (patch)
tree3100714738a7941b590efee466a774862f9671c3 /doc/GetPixels.3
parente4ab1102029f9ac557ff190bfb9d34408340f345 (diff)
downloadtk-13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22.zip
tk-13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22.tar.gz
tk-13242623d2ff3ea02ab6a62bfb48a7dbb5c27e22.tar.bz2
Initial revision
Diffstat (limited to 'doc/GetPixels.3')
-rw-r--r--doc/GetPixels.376
1 files changed, 76 insertions, 0 deletions
diff --git a/doc/GetPixels.3 b/doc/GetPixels.3
new file mode 100644
index 0000000..6b26eb3
--- /dev/null
+++ b/doc/GetPixels.3
@@ -0,0 +1,76 @@
+'\"
+'\" Copyright (c) 1990 The Regents of the University of California.
+'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" SCCS: @(#) GetPixels.3 1.8 96/03/26 18:11:30
+'\"
+.so man.macros
+.TH Tk_GetPixels 3 "" Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_GetPixels, Tk_GetScreenMM \- translate between strings and screen units
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+int
+\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR
+.sp
+int
+\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR
+.SH ARGUMENTS
+.AS "Tcl_Interp" *joinPtr
+.AP Tcl_Interp *interp in
+Interpreter to use for error reporting.
+.AP Tk_Window tkwin in
+Window whose screen geometry determines the conversion between absolute
+units and pixels.
+.AP char *string in
+String that specifies a distance on the screen.
+.AP int *intPtr out
+Pointer to location in which to store converted distance in pixels.
+.AP double *doublePtr out
+Pointer to location in which to store converted distance in millimeters.
+.BE
+
+.SH DESCRIPTION
+.PP
+These two procedures take as argument a specification of distance on
+the screen (\fIstring\fR) and compute the corresponding distance
+either in integer pixels or floating-point millimeters.
+In either case, \fIstring\fR specifies a screen distance as a
+floating-point number followed by one of the following characters
+that indicates units:
+.TP
+<none>
+The number specifies a distance in pixels.
+.TP
+\fBc\fR
+The number specifies a distance in centimeters on the screen.
+.TP
+\fBi\fR
+The number specifies a distance in inches on the screen.
+.TP
+\fBm\fR
+The number specifies a distance in millimeters on the screen.
+.TP
+\fBp\fR
+The number specifies a distance in printer's points (1/72 inch)
+on the screen.
+.PP
+\fBTk_GetPixels\fR converts \fIstring\fR to the nearest even
+number of pixels and stores that value at \fI*intPtr\fR.
+\fBTk_GetScreenMM\fR converts \fIstring\fR to millimeters and
+stores the double-precision floating-point result at \fI*doublePtr\fR.
+.PP
+Both procedures return \fBTCL_OK\fR under normal circumstances.
+If an error occurs (e.g. \fIstring\fR contains a number followed
+by a character that isn't one of the ones above) then
+\fBTCL_ERROR\fR is returned and an error message is left
+in \fIinterp->result\fR.
+
+.SH KEYWORDS
+centimeters, convert, inches, millimeters, pixels, points, screen units