Difference between revisions of "gc:clipRect"
Jump to navigation
Jump to search
(→Syntax) |
|||
Line 22: | Line 22: | ||
|- | |- | ||
|} | |} | ||
+ | |||
Details about the "op" parameter : | Details about the "op" parameter : | ||
− | |||
− | |||
Parameter op takes one of the strings “set”, “reset”, “intersect”, or “null”. | Parameter op takes one of the strings “set”, “reset”, “intersect”, or “null”. | ||
* '''reset''' sets the clipping rectangle to include the entire window. The remaining parameters is ignored and can be left out. | * '''reset''' sets the clipping rectangle to include the entire window. The remaining parameters is ignored and can be left out. | ||
Line 32: | Line 31: | ||
* '''null''' sets the clipping rectangle to empty. All subsequent graphics commands will be ignored. | * '''null''' sets the clipping rectangle to empty. All subsequent graphics commands will be ignored. | ||
Typically the “set” operation is called before drawing, say, a text string. It is important to call the “reset” operation after drawing the last clipped graphic so that you don’t leave a lingering clipping rectangle as a side effect. | Typically the “set” operation is called before drawing, say, a text string. It is important to call the “reset” operation after drawing the last clipped graphic so that you don’t leave a lingering clipping rectangle as a side effect. | ||
− | |||
== Example == | == Example == |
Revision as of 16:34, 9 July 2011
clipRect is a function that is part of gc.
Sets the clipping rectangle for subsequent graphics operations.
This has been introduced in TI-Nspire OS 3.0 (Changes).
Syntax
gc:clipRect(op, x, y, width, height)
Parameter | Type | Description |
---|---|---|
string | Can either be "set", "intersect", "reset", or "null" | |
number | x coordinate | |
number | y coordinate | |
number | the width of the rectangle | |
number | the height of the rectangle |
Details about the "op" parameter :
Parameter op takes one of the strings “set”, “reset”, “intersect”, or “null”.
- reset sets the clipping rectangle to include the entire window. The remaining parameters is ignored and can be left out.
- set sets the clipping rectangle to the x, y coordinates with the specified width and height. The remaining parameters default to the system window location and size.
- intersect sets the clipping rectangle to the intersection of the current clipping rectangle with the rectangle specified in the routine parameters.
- null sets the clipping rectangle to empty. All subsequent graphics commands will be ignored.
Typically the “set” operation is called before drawing, say, a text string. It is important to call the “reset” operation after drawing the last clipped graphic so that you don’t leave a lingering clipping rectangle as a side effect.
Example
gc:clipRect("set", 20, 20, 50, 10)