Function GraSegOpen() Foundation
Begins the definition of a graphic segment.
GraSegOpen( [<oPS>], [<nMode>], [<nSegmentID>] ) --> nSegmentID
GraSegOpen() returns a numeric value by which the graphic segment is later identified. If the constant GRA_SEG_NIL is used for <nMode>, the return value is always 0.
The function GraSegOpen() begins the definition for a graphic segment. A segment is created using graphic primitives such as GraLine(), GraArc(), GraSpline() or GraStringAt() and must be terminated by the function GraSegClose(). A segment records all graphic primitives which are executed between GraSegOpen() and GraSegClose(). A segment can then be drawn on the screen repeatedly without further calls to the graphic primitives. The drawing of a segment occurs using the function GraSegDraw().
When GraSegOpen() is called, the current attribute settings for graphic primitives are not stored in the new segment. When a segment is to store colors or line attributes, for example, the attributes must be re-defined after the segment is opened.
A graphic segment is similar to a graphic path. But, multiple operations can be performed with a segment while only one can be performed with a path. For many operations, like scaling or rotation, a segment must be identified through its numeric segment ID returned by GraSegOpen().
The functions GraSegOpen() and GraSegClose() cannot be nested. After GraSegOpen(), a call to the function GraSegClose() must occur so that graphic primitives can again be used for normal drawing without being recorded in a segment. In addition, it is not possible to create graphic segments as part of a graphic path (a call to GraSegOpen() within GraPathBegin() ... GraPathEnd() is illegal).
Limitations
Within a presentation space many segments can exist with the segment ID 0, each segment ID not equal to zero exists only once. The maximum number of segments for a presentation space is limited to 16378 (16kB).
Display modes for graphic segments
The drawing or output of a graphic segment occurs in a presentation space which represents an abstract drawing surface (see XbpPresSpace()). The presentation space defines the display mode for graphic segments via the method :drawMode(). As an alternative, the display mode can be set by the function GraSegDrawMode() (see GraSegDrawMode()). In the default display mode GRA_DM_DRAWANDRETAIN, a graphic segment is already visible when the function GraSegClose() is called.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.