SclViewport getpixelsize
Overview
You use this command to find the X and Y pixel dimensions of a viewport.
Synopsis
SclViewport getpixelsize <$viewportHandle> <xPixelSize> <yPixelSize>
Description
Gets the pixel dimensions for the viewport referred to by the handle. The X and Y pixel dimensions are assigned to specified Tcl variables, for example, “xPixelSize” and “yPixelSize”.
Arguments
- getpixelsize
This is the string that identifies the function. This argument must be included to run this command.
- <$viewportHandle>
Passed by value. The reference handle of the viewport to get the pixel dimensions from.
- <xPixelSize>
Passed by value. Returns the X pixel dimension.
- <yPixelSize>
Passed by value. Returns the Y pixel dimension.
Returns
If successful, this command returns $SCL_OK. If the viewport handle is not valid, an error message is returned.
Example
# Get the X and Y pixel dimensions of the current viewport and # print them to the output window. set vp1 [SclViewport getActive] set result [SclViewport getpixelsize $vp1 xPixels yPixels] puts $xPixels puts $yPixels |