home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / GetPixels.3 < prev    next >
Encoding:
Text File  |  1993-04-01  |  3.2 KB  |  92 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/GetPixels.3,v 1.3 93/04/01 09:41:36 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tk_GetPixels tkc
  25. .BS
  26. .SH NAME
  27. .VS
  28. Tk_GetPixels, Tk_GetScreenMM \- translate between strings and screen units
  29. .SH SYNOPSIS
  30. .nf
  31. \fB#include <tk.h>\fR
  32. .sp
  33. int
  34. \fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR
  35. .sp
  36. int
  37. \fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR
  38. .SH ARGUMENTS
  39. .AS "Tcl_Interp" *joinPtr
  40. .AP Tcl_Interp *interp in
  41. Interpreter to use for error reporting.
  42. .AP Tk_Window tkwin in
  43. Window whose screen geometry determines the conversion between absolute
  44. units and pixels. 
  45. .AP char *string in
  46. String that specifies a distance on the screen.
  47. .AP int *intPtr out
  48. Pointer to location in which to store converted distance in pixels.
  49. .AP double *doublePtr out
  50. Pointer to location in which to store converted distance in millimeters.
  51. .BE
  52.  
  53. .SH DESCRIPTION
  54. .PP
  55. These two procedures take as argument a specification of distance on
  56. the screen (\fIstring\fR) and compute the corresponding distance
  57. either in integer pixels or floating-point millimeters.
  58. In either case, \fIstring\fR specifies a screen distance as a
  59. floating-point number followed by one of the following characters
  60. that indicates units:
  61. .TP
  62. <none>
  63. The number specifies a distance in pixels.
  64. .TP
  65. \fBc\fR
  66. The number specifies a distance in centimeters on the screen.
  67. .TP
  68. \fBi\fR
  69. The number specifies a distance in inches on the screen.
  70. .TP
  71. \fBm\fR
  72. The number specifies a distance in millimeters on the screen.
  73. .TP
  74. \fBp\fR
  75. The number specifies a distance in printer's points (1/72 inch)
  76. on the screen.
  77. .PP
  78. \fBTk_GetPixels\fR converts \fIstring\fR to the nearest even
  79. number of pixels and stores that value at \fI*intPtr\fR.
  80. \fBTk_GetScreenMM\fR converts \fIstring\fR to millimeters and
  81. stores the double-precision floating-point result at \fI*doublePtr\fR.
  82. .PP
  83. Both procedures return \fBTCL_OK\fR under normal circumstances.
  84. If an error occurs (e.g. \fIstring\fR contains a number followed
  85. by a character that isn't one of the ones above) then
  86. \fBTCL_ERROR\fR is returned and an error message is left
  87. in \fIinterp->result\fR.
  88.  
  89. .SH KEYWORDS
  90. centimeters, convert, inches, millimeters, pixels, points, screen units
  91. .VE
  92.