A graphics order is a low-level graphics command that corresponds to a primitive function or attribute. In addition to code and data requirements, each graphics order uses approximately 11 bytes of storage. An application that uses 2000 graphics drawing orders will use around 22KB of memory to store them. The following table describes the four sizes of graphics orders.

Graphics Orders

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Graphics Order Size     ³Content                             ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³1 byte                  ³A hexadecimal identifier            ³
³                        ³corresponding to a drawing function ³
³                        ³or attribute function. This         ³
³                        ³identifier is also known as the     ³
³                        ³order code.                         ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³2 byte                  ³The order code is in the first byte,³
³                        ³and data is in the second byte.     ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Long                    ³The order code is in the first byte.³
³                        ³                                    ³
³                        ³The length value of the actual data,³
³                        ³in bytes, is in the second byte.    ³
³                        ³                                    ³
³                        ³The actual data (up to 255 bytes).  ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Very long               ³A hexadecimal identifier            ³
³(maximum length of 64KB)³specifically for extended orders, is³
³                        ³in the first byte.                  ³
³                        ³                                    ³
³                        ³The order code is in the second     ³
³                        ³byte.                               ³
³                        ³                                    ³
³                        ³A length value that specifies how   ³
³                        ³many bytes are used by the          ³
³                        ³graphics-order arguments, (high     ³
³                        ³order) is in the third byte.        ³
³                        ³                                    ³
³                        ³A length value that specifies how   ³
³                        ³many bytes are used by the          ³
³                        ³graphics-order arguments, (low      ³
³                        ³order) is in the fourth byte.       ³
³                        ³                                    ³
³                        ³The actual data.                    ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

The following example shows a long graphics order that corresponds to GpiLine:

    81 8 100 0 0 0 100 0 0 0

The first number, 81, is the hexadecimal identifier that corresponds to GpiLine. The second number, 8, is the length value that specifies how many bytes are used by the graphics-order arguments. The next eight bytes contain the arguments for GpiLine. In this case, the arguments specify the line's end point at (100,100).


                               Graphics
                               Segment
                                      ³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿  ÚÄÄ  0x21  ÅÄÄÄÄÄÄÄÄÄÄ order # ÄÄ¿
³                      ³  ³     0x08  ÅÄÄÄÄÄÄÄÄÄÄ length    ³
³ ptl.x = 100L;        ³  ³     0x00  ³ ÄÄÄÄ¿               ³
³ ptl.y = 100L;        ³  ³     0x00  ³     ÃÄÄ      x      ³
³ GpiMove (hps, &ptl); ÅÄÄÙ     0x10  ³     ³               ÃÄÄ  element
³ ptl.x = 200L;        ³        0x00  ³ ÄÄÄÄÙ               ³
³ ptl.y = 400L;        ³        0x00  ³ ÄÄÄÄ¿               ³
³ GpiMove (hps, &ptl); ÅÄÄ¿     0x00  ³     ÃÄÄ      y      ³
³                      ³  ³     0x20  ³     ³               ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ  ³     0x00  ³ ÄÄÄÄÙ             ÄÄÙ
                          ÀÄÄ  0x81  ÅÄÄÄÄÄÄÄÄÄÄ order # ÄÄ¿
                                0x08  ÅÄÄÄÄÄÄÄÄÄÄ length    ³
                                0x00  ³ ÄÄÄÄ¿               ³
                                0x00  ³     ÃÄÄ      x      ³
                                0x30  ³     ³               ÃÄÄ  element
                                0x00  ³ ÄÄÄÄÙ               ³
                                0x00  ³ ÄÄÄÄ¿               ³
                                0x00  ³     ÃÄÄ      y      ³
                                0x40  ³     ³               ³
                                0x00  ³ ÄÄÄÄÙ             ÄÄÙ
                                      ³


Graphics Orders

The encoding that appears in the Graphics Segments column is a hexadecimal version of the order, length, and parameter information.

In most cases, graphics orders in a segment correspond to a subpicture, which is part of a complete, more complex picture. Your application would combine the individual segments to form the complete picture.

Three drawing modes affect how the operating system stores graphics orders in segments. These modes are described in the following table. The default drawing mode is draw (DM_DRAW). To specify another as the current drawing mode, use GpiSetDrawingMode.

The actual drawing mode is a combination of the drawing mode as set using GpiSetDrawingMode, and the segment status-chained, unchained, or outside of the segment. The actual drawing mode does not affect the storing of orders in segments.

Segment Graphics Drawing Modes

ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Drawing Mode      ³GpiSetDrawingMode ³When this mode is set...³
³                  ³Value             ³                        ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Draw              ³DM_DRAW           ³it is not possible to   ³
³                  ³                  ³store graphics orders in³
³                  ³                  ³a chained segment.      ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Retain            ³DM_RETAIN         ³your application can    ³
³                  ³                  ³store graphics orders in³
³                  ³                  ³chained and unchained   ³
³                  ³                  ³segments.               ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³Draw-and-retain   ³DM_DRAWANDRETAIN  ³your application can    ³
³                  ³                  ³store graphics orders in³
³                  ³                  ³chained and unchained   ³
³                  ³                  ³segments.  In this mode,³
³                  ³                  ³output intended for a   ³
³                  ³                  ³chained segment is both ³
³                  ³                  ³drawn on the device and ³
³                  ³                  ³stored in a segment.    ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ


[Back] [Next]