Up: GEOS SDK TechDocs | Up | Prev: GrApplyTranslation() ... | Next: GrDestroyBitmap() ...

GrClearBitmap()

void	GrClearBitmap(
        GStateHandle 	gstate);			/* GState to affect */

Clear out the content of a bitmap. Note that the part of the bitmap actually cleared depends on the bitmap mode. For the normal mode, the data portion of the bitmap is cleared. If the bitmap is in BM_EDIT_MASK mode, then the mask is cleared and the data portion is left alone.

Include: graphics.h

GrCloseSubPath()

void	GrCloseSubPath(
        GStateHandle gstate);			/* GState to affect */

Geometrically closes the currently open path segment. Note that you must still call GrEndPath() to end the path definition.

Include: graphics.h

GrComment()

void	GrComment(
        GStateHandle		gstate,			/* GState to affect */
        const void  		* data,			/* comment string */
        word		size);			/* Size of data, in bytes */

Write a comment out to a graphics string.

Include: graphics.h

GrCopyGString()

GSRetType GrCopyGString(
        GStateHandle		source,			/* GState from which to get GString */
        GStateHandle		dest,			/* GState to which to copy GString */
        GSControl 		flags);			/* flags for the copy */

Copy all or part of a Graphics String. The GSControl record can have the following flags:

 GSC_ONE			/* just do one element */
 GSC_MISC			/* return on MISC opcode */
 GSC_LABEL			/* return on GR_LABEL opcode */
 GSC_ESCAPE			/* return on GR_ESCAPE opcode */
 GSC_NEW_PAGE			/* return when we get to a NEW_PAGE */
 GSC_XFORM			/* return on TRANSFORMATIONopcode */
 GSC_OUTPUT:			/* return on OUTPUT opcode */
 GSC_ATTR			/* return on ATTRIBUTE opcode */
 GSC_PATH			/* return on PATH opcode */

The return value can be any one of GSRetType , a byte-size field:

GSRT_COMPLETE
GSRT_ONE
GSRT_MISC
GSRT_LABEL
GSRT_ESCAPE
GSRT_NEW_PAGE
GSRT_XFORM
GSRT_OUTPUT
GSRT_ATTR
GSRT_PATH
GSRT_FAULT

Include: gstring.h

GrCreateBitmap()

VMBlockHandle GrCreateBitmap(
        BMFormat 		initFormat,				/* color fomat of bitmap */
        word		initWidth,				/* initial width of bitmap */
        word		initHeight,				/* initial height of bitmap */
        VMFileHandle 		vmFile,				/* VM file to hold bitmap's data*/
        optr 		exposureOD,				/* optr to get MSG_META_EXPOSED */
        GStateHandle		* bmgs);				/* Draws to this GState
							 * will draw to the bitmap */

This routine allocates memory for a bitmap and creates an off-screen window in which to hold the bitmap. This routine takes the following arguments:

initFormat
The depth of the bitmap's color.
initWidth
Bitmap's width.
initHeight
Bitmap's height.
vmFile
File to hold the bitmap data; the routine will allocate a block within this file.
exposureOD Object which will receive the "exposed" message when the bitmap's window is invalidated. If this argument is zero, then no exposed message will be sent.
Remember that an off-screen window is created to house the bitmap. When this window is first created, it will be invalid, and it is conceivable that later actions could cause it to become invalid again. On these occasions, the object specified by this argument will receive a MSG_META_EXPOSED.
bmgs
The GStateHandle pointed to by this argument can start out as null; the routine will use it to return the GState by which the bitmap can be drawn to. Any graphics routines which draw to this returned GState will be carried out upon the bitmap.

The routine returns a VMBlockHandle , the handle of the block within the passed VM file which contains the bitmap's data. The block will be set up as the first block of a HugeArray. Its header area will be filled with the following:

Complex Bitmap Header
This is a CBitmap structure which contains some basic information about the bitmap.
Editing Mode
These flags can change how the bitmap is being edited.
Device Information Block
This internal structure contains information about and used by the video driver. (Don't worry that you don't know the size of this structure; remember that the CBitmap structure contains the offsets of the bitmap and palette data areas.)
Pallette Information (optional)
If the bitmap has its own pallette, this is where the palette data will be stored; it will consist of an array of 3-byte entries. Depending on how many colors the bitmap supports, there may be 16 or 256 entries in this array.

The bitmap's raw data is in the VM block, but outside of the header area.

Include: graphics.h

GrCreateGString()

GStateHandle GrCreateGString(
        Handle		han,			/* memory, stream, or VM file handle */
        GStringType		hanType,			/* type of handle in han parameter */
        word		* gsBlock);				/* returned for GST_MEMORY and 
						 * GST_VMEM types only */

Open a graphics string and start redirecting graphics orders to the string. The hanType parameter must be GST_MEMORY, GST_STREAM, or GST_VMEM.

Include: gstring.h

GrCreatePalette()

word	GrCreatePalette( /* Returns # of entries in color table
            * or 0 for monochrome or 24-bit */
        GStateHandle gstate);

Create a color mapping table and associate it with the current window. Initialize the table entries to the default palette for the device.

Include: graphics.h

GrCreateState()

GStateHandle GrCreateState(
        WindowHandle win);			/* Window in which GState will be active */

Create a graphics state (GState) block containg default GState information.

If zero is passed, then the GState created will have no window associated with it.

Include: graphics.h

GrDeleteGStringElement()

void	GrDeleteGStringElement(
        GStateHandle		gstate,			/* GState containing GString */
        word		count);			/* number of elements to delete */

Delete a range of GString elements from the GString in the passed GState.

Include: graphics.h


Up: GEOS SDK TechDocs | Up | Prev: GrApplyTranslation() ... | Next: GrDestroyBitmap() ...