OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tk/] [doc/] [GetPixels.3] - Blame information for rev 578

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1990 The Regents of the University of California.
3
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4
'\"
5
'\" See the file "license.terms" for information on usage and redistribution
6
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7
'\"
8
'\" RCS: @(#) $Id: GetPixels.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
9
'\"
10
.so man.macros
11
.TH Tk_GetPixels 3 "" Tk "Tk Library Procedures"
12
.BS
13
.SH NAME
14
Tk_GetPixels, Tk_GetScreenMM \- translate between strings and screen units
15
.SH SYNOPSIS
16
.nf
17
\fB#include \fR
18
.sp
19
int
20
\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR
21
.sp
22
int
23
\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR
24
.SH ARGUMENTS
25
.AS "Tcl_Interp" *joinPtr
26
.AP Tcl_Interp *interp in
27
Interpreter to use for error reporting.
28
.AP Tk_Window tkwin in
29
Window whose screen geometry determines the conversion between absolute
30
units and pixels.
31
.AP char *string in
32
String that specifies a distance on the screen.
33
.AP int *intPtr out
34
Pointer to location in which to store converted distance in pixels.
35
.AP double *doublePtr out
36
Pointer to location in which to store converted distance in millimeters.
37
.BE
38
 
39
.SH DESCRIPTION
40
.PP
41
These two procedures take as argument a specification of distance on
42
the screen (\fIstring\fR) and compute the corresponding distance
43
either in integer pixels or floating-point millimeters.
44
In either case, \fIstring\fR specifies a screen distance as a
45
floating-point number followed by one of the following characters
46
that indicates units:
47
.TP
48
49
The number specifies a distance in pixels.
50
.TP
51
\fBc\fR
52
The number specifies a distance in centimeters on the screen.
53
.TP
54
\fBi\fR
55
The number specifies a distance in inches on the screen.
56
.TP
57
\fBm\fR
58
The number specifies a distance in millimeters on the screen.
59
.TP
60
\fBp\fR
61
The number specifies a distance in printer's points (1/72 inch)
62
on the screen.
63
.PP
64
\fBTk_GetPixels\fR converts \fIstring\fR to the nearest even
65
number of pixels and stores that value at \fI*intPtr\fR.
66
\fBTk_GetScreenMM\fR converts \fIstring\fR to millimeters and
67
stores the double-precision floating-point result at \fI*doublePtr\fR.
68
.PP
69
Both procedures return \fBTCL_OK\fR under normal circumstances.
70
If an error occurs (e.g. \fIstring\fR contains a number followed
71
by a character that isn't one of the ones above) then
72
\fBTCL_ERROR\fR is returned and an error message is left
73
in \fIinterp->result\fR.
74
 
75
.SH KEYWORDS
76
centimeters, convert, inches, millimeters, pixels, points, screen units

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.