GetPixels.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1990 The Regents of the University of California.
- '" Copyright (c) 1994-1998 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: GetPixels.3,v 1.4 2002/01/25 21:09:36 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM - translate between strings and screen units
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- .VS 8.1
- int
- fBTk_GetPixelsFromObj(fIinterp, tkwin, objPtr, intPtrfB)fR
- .VE
- .sp
- int
- fBTk_GetPixels(fIinterp, tkwin, string, intPtrfB)fR
- .sp
- .VS 8.1
- int
- fBTk_GetMMFromObj(fIinterp, tkwin, objPtr, doublePtrfB)fR
- .VE
- .sp
- int
- fBTk_GetScreenMM(fIinterp, tkwin, string, doublePtrfB)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.
- .VS 8.1 br
- .AP Tcl_Obj *objPtr in/out
- String value specifies a distance on the screen;
- internal rep will be modified to cache converted distance.
- .AP "CONST char" *string in
- Same as fIobjPtrfR except specification of distance is passed as
- a string.
- .VE
- .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 procedures take as argument a specification of distance on
- .VS 8.1
- the screen (fIobjPtrfR or fIstringfR) and compute the
- .VE
- corresponding distance either in integer pixels or floating-point millimeters.
- In either case,
- .VS 8.1
- fIobjPtrfR or fIstringfR
- .VE
- 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
- fBcfR
- The number specifies a distance in centimeters on the screen.
- .TP
- fBifR
- The number specifies a distance in inches on the screen.
- .TP
- fBmfR
- The number specifies a distance in millimeters on the screen.
- .TP
- fBpfR
- The number specifies a distance in printer's points (1/72 inch)
- on the screen.
- .PP
- .VS 8.1
- fBTk_GetPixelsFromObjfR converts the value of fIobjPtrfR to the
- nearest even number of pixels and stores that value at fI*intPtrfR.
- It returns fBTCL_OKfR under normal circumstances.
- If an error occurs (e.g. fIobjPtrfR contains a number followed
- by a character that isn't one of the ones above) then
- fBTCL_ERRORfR is returned and an error message is left
- in fIinterpfR's result if fIinterpfR isn't NULL.
- fBTk_GetPixelsFromObjfR caches information about the return
- value in fIobjPtrfR, which speeds up future calls to
- fBTk_GetPixelsFromObjfR with the same fIobjPtrfR.
- .PP
- fBTk_GetPixelsfR is identical to fBTk_GetPixelsFromObjfR except
- that the screen distance is specified with a string instead
- of an object. This prevents fBTk_GetPixelsfR from caching the
- return value, so fBTk_GetAnchorfR is less efficient than
- fBTk_GetPixelsFromObjfR.
- .PP
- fBTk_GetMMFromObjfR and fBTk_GetScreenMMfR are similar to
- fBTk_GetPixelsFromObjfR and fBTk_GetPixelsfR (respectively) except
- that they convert the screen distance to millimeters and
- store a double-precision floating-point result at fI*doublePtrfR.
- .VE
- .SH KEYWORDS
- centimeters, convert, inches, millimeters, pixels, points, screen units