GetPixels.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
源码类别:

通讯编程

开发平台:

Visual C++

  1. '"
  2. '" Copyright (c) 1990 The Regents of the University of California.
  3. '" Copyright (c) 1994-1998 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.4 2002/01/25 21:09:36 dgp Exp $
  9. '" 
  10. .so man.macros
  11. .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures"
  12. .BS
  13. .SH NAME
  14. Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM - translate between strings and screen units
  15. .SH SYNOPSIS
  16. .nf
  17. fB#include <tk.h>fR
  18. .sp
  19. .VS 8.1
  20. int
  21. fBTk_GetPixelsFromObj(fIinterp, tkwin, objPtr, intPtrfB)fR
  22. .VE
  23. .sp
  24. int
  25. fBTk_GetPixels(fIinterp, tkwin, string, intPtrfB)fR
  26. .sp
  27. .VS 8.1
  28. int
  29. fBTk_GetMMFromObj(fIinterp, tkwin, objPtr, doublePtrfB)fR
  30. .VE
  31. .sp
  32. int
  33. fBTk_GetScreenMM(fIinterp, tkwin, string, doublePtrfB)fR
  34. .SH ARGUMENTS
  35. .AS "Tcl_Interp" *joinPtr
  36. .AP Tcl_Interp *interp in
  37. Interpreter to use for error reporting.
  38. .AP Tk_Window tkwin in
  39. Window whose screen geometry determines the conversion between absolute
  40. units and pixels.
  41. .VS 8.1 br
  42. .AP Tcl_Obj *objPtr in/out
  43. String value specifies a distance on the screen;
  44. internal rep will be modified to cache converted distance.
  45. .AP "CONST char" *string in
  46. Same as fIobjPtrfR except specification of distance is passed as
  47. a string.
  48. .VE
  49. .AP int *intPtr out
  50. Pointer to location in which to store converted distance in pixels.
  51. .AP double *doublePtr out
  52. Pointer to location in which to store converted distance in millimeters.
  53. .BE
  54. .SH DESCRIPTION
  55. .PP
  56. These procedures take as argument a specification of distance on
  57. .VS 8.1
  58. the screen (fIobjPtrfR or fIstringfR) and compute the
  59. .VE
  60. corresponding distance either in integer pixels or floating-point millimeters.
  61. In either case,
  62. .VS 8.1
  63. fIobjPtrfR or fIstringfR
  64. .VE
  65. specifies a screen distance as a
  66. floating-point number followed by one of the following characters
  67. that indicates units:
  68. .TP
  69. <none>
  70. The number specifies a distance in pixels.
  71. .TP
  72. fBcfR
  73. The number specifies a distance in centimeters on the screen.
  74. .TP
  75. fBifR
  76. The number specifies a distance in inches on the screen.
  77. .TP
  78. fBmfR
  79. The number specifies a distance in millimeters on the screen.
  80. .TP
  81. fBpfR
  82. The number specifies a distance in printer's points (1/72 inch)
  83. on the screen.
  84. .PP
  85. .VS 8.1
  86. fBTk_GetPixelsFromObjfR converts the value of fIobjPtrfR to the
  87. nearest even number of pixels and stores that value at fI*intPtrfR.
  88. It returns fBTCL_OKfR under normal circumstances.
  89. If an error occurs (e.g. fIobjPtrfR contains a number followed
  90. by a character that isn't one of the ones above) then
  91. fBTCL_ERRORfR is returned and an error message is left
  92. in fIinterpfR's result if fIinterpfR isn't NULL.
  93. fBTk_GetPixelsFromObjfR caches information about the return
  94. value in fIobjPtrfR, which speeds up future calls to
  95. fBTk_GetPixelsFromObjfR with the same fIobjPtrfR.
  96. .PP
  97. fBTk_GetPixelsfR is identical to fBTk_GetPixelsFromObjfR except
  98. that the screen distance is specified with a string instead
  99. of an object.  This prevents fBTk_GetPixelsfR from caching the
  100. return value, so fBTk_GetAnchorfR is less efficient than
  101. fBTk_GetPixelsFromObjfR.
  102. .PP
  103. fBTk_GetMMFromObjfR and fBTk_GetScreenMMfR are similar to
  104. fBTk_GetPixelsFromObjfR and fBTk_GetPixelsfR (respectively) except
  105. that they convert the screen distance to millimeters and
  106. store a double-precision floating-point result at fI*doublePtrfR.
  107. .VE
  108. .SH KEYWORDS
  109. centimeters, convert, inches, millimeters, pixels, points, screen units