Nano-X API Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
|
|
Creates a new graphics context structure and returns the ID used to refer to it. The structure is initialised with a set of default parameters.
Returns : | the ID of the newly created graphics context or 0 on error |
|
Creates a new graphics context structure and fills it in with the values from the specified already existing graphics context.
gc : | the already existing graphics context to copy the parameters from |
Returns : | the ID of the newly created graphics context or 0 on error |
void GrGetGCInfo ( |
Fills in the specified GR_GC_INFO structure with information regarding the specified graphics context.
gc : | a graphics context |
gcip : | pointer to a GR_GC_INFO structure |
void GrDestroyGC ( |
Destroys the graphics context structure with the specified ID.
gc : | the ID of the graphics context structure to destroy |
void GrLine ( |
Draws a line using the specified graphics context on the specified drawable from (x1, y1) to (x2, y2), with coordinates given relative to the drawable.
id : | the ID of the drawable to draw the line on |
gc : | the ID of the graphics context to use when drawing the line |
x1 : | the X coordinate of the start of the line relative to the drawable |
y1 : | the Y coordinate of the start of the line relative to the drawable |
x2 : | the X coordinate of the end of the line relative to the drawable |
y2 : | the Y coordinate of the end of the line relative to the drawable |
void GrPoint ( |
Draws a point using the specified graphics context at the specified position on the specified drawable.
id : | the ID of the drawable to draw a point on |
gc : | the ID of the graphics context to use when drawing the point |
x : | the X coordinate to draw the point at relative to the drawable |
y : | the Y coordinate to draw the point at relative to the drawable |
void GrPoints ( |
Draws a set of points using the specified graphics context at the positions specified by the point table on the specified drawable.
id : | the ID of the drawable to draw a point on |
gc : | the ID of the graphics context to use when drawing the point |
count : | the number of points in the point table |
pointtable : | pointer to a GR_POINT array which lists the points to draw |
void GrRect ( |
Draw the boundary of a rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.
id : | the ID of the drawable to draw the rectangle on |
gc : | the ID of the graphics context to use when drawing the rectangle |
x : | the X coordinate of the rectangle relative to the drawable |
y : | the Y coordinate of the rectangle relative to the drawable |
width : | the width of the rectangle |
height : | the height of the rectangle |
void GrFillRect ( |
Draw a filled rectangle of the specified dimensions and position on the specified drawable using the specified graphics context.
id : | the ID of the drawable to draw the rectangle on |
gc : | the ID of the graphics context to use when drawing the rectangle |
x : | the X coordinate of the rectangle relative to the drawable |
y : | the Y coordinate of the rectangle relative to the drawable |
width : | the width of the rectangle |
height : | the height of the rectangle |
void GrPoly ( |
Draws an unfilled polygon on the specified drawable using the specified graphics context. The polygon is specified by an array of point structures. The polygon is not automatically closed- if a closed polygon is desired, the last point must be the same as the first.
id : | the ID of the drawable to draw the polygon onto |
gc : | the ID of the graphics context to use when drawing the polygon |
count : | the number of points in the point array |
pointtable : | pointer to an array of points describing the polygon |
void GrFillPoly ( |
Draws a filled polygon on the specified drawable using the specified graphics context. The polygon is specified by an array of point structures. The polygon is automatically closed- the last point need not be the same as the first in order for the polygon to be closed.
id : | the ID of the drawable to draw the polygon onto |
gc : | the ID of the graphics context to use when drawing the polygon |
count : | the number of points in the point array |
pointtable : | pointer to an array of points describing the polygon |
void GrEllipse ( |
Draws the boundary of ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.
id : | the ID of the drawable to draw the ellipse on |
gc : | the ID of the graphics context to use when drawing the ellipse |
x : | the X coordinate to draw the ellipse at relative to the drawable |
y : | the Y coordinate to draw the ellipse at relative to the drawable |
rx : | the radius of the ellipse on the X axis |
ry : | the radius of the ellipse on the Y axis |
void GrFillEllipse ( |
Draws a filled ellipse at the specified position using the specified dimensions and graphics context on the specified drawable.
id : | the ID of the drawable to draw the filled ellipse on |
gc : | the ID of the graphics context to use when drawing the ellipse |
x : | the X coordinate to draw the ellipse at relative to the drawable |
y : | the Y coordinate to draw the ellipse at relative to the drawable |
rx : | the radius of the ellipse on the X axis |
ry : | the radius of the ellipse on the Y axis |
void GrArc ( |
Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context. The type specifies the fill type. Possible values include GR_ARC and GR_PIE.
id : | the ID of the drawable to draw the arc on |
gc : | the graphics context to use when drawing the arc |
x : | the X coordinate to draw the arc at relative to the drawable |
y : | the Y coordinate to draw the arc at relative to the drawable |
rx : | the radius of the arc on the X axis |
ry : | the radius of the arc on the Y axis |
ax : | the X coordinate of the start of the arc relative to the drawable |
ay : | the Y coordinate of the start of the arc relative to the drawable |
bx : | the X coordinate of the end of the arc relative to the drawable |
by : | the Y coordinate of the end of the arc relative to the drawable |
type : | the fill style to use when drawing the arc |
void GrArcAngle ( |
Draws an arc with the specified dimensions at the specified position on the specified drawable using the specified graphics context. The type specifies the fill type. Possible values include GR_ARC and GR_PIE. This function requires floating point support, and is slightly slower than the GrArc() function which does not require floating point.
id : | the ID of the drawable to draw the arc on |
gc : | the graphics context to use when drawing the arc |
x : | the X coordinate to draw the arc at relative to the drawable |
y : | the Y coordinate to draw the arc at relative to the drawable |
rx : | the radius of the arc on the X axis |
ry : | the radius of the arc on the Y axis |
angle1 : | the angle of the start of the arc |
angle2 : | the angle of the end of the arc |
type : | the fill style to use when drawing the arc |
void GrSetGCForeground ( |
Changes the foreground colour of the specified graphics context to the specified colour.
gc : | the ID of the graphics context to set the foreground colour of |
foreground : | the colour to use as the new foreground colour |
void GrSetGCBackground ( |
Changes the background colour of the specified graphics context to the specified colour.
gc : | the ID of the graphics context to set the background colour of |
background : | the colour to use as the new background colour |
void GrSetGCUseBackground ( |
Sets the flag which chooses whether or not the background colour is used when drawing bitmaps and text using the specified graphics context to the specified value.
gc : | the ID of the graphics context to change the "use background" flag of |
flag : | flag specifying whether to use the background colour or not |
void GrSetGCMode ( |
Changes the drawing mode (SET, XOR, OR, AND, etc.) of the specified graphics context to the specified mode.
gc : | the ID of the graphics context to set the drawing mode of |
mode : | the new drawing mode |
void GrSetGCFont ( |
Sets the font to be used for text drawing in the specified graphics context to the specified font ID.
gc : | the ID of the graphics context to set the font of |
font : | the ID of the font |
void GrGetGCTextSize ( |
Calculates the dimensions of the specified text string using the current font and flags in the specified graphics context. The count argument can be -1 if the string is null terminated.
gc : | the graphics context |
str : | pointer to a text string |
count : | the length of the string |
flags : | text rendering flags (GR_TF*) |
retwidth : | pointer to the variable the width will be returned in |
retheight : | pointer to the variable the height will be returned in |
retbase : | pointer to the variable the baseline height will be returned in |
void GrReadArea ( |
Reads the pixel data of the specified size from the specified position on the specified drawable into the specified pixel array. If the drawable is a window, the data returned will be the pixel values from the relevant position on the screen regardless of whether the window is obscured by other windows. If the window is unmapped, or partially or fully outside a window boundary, black pixel values will be returned.
id : | the ID of the drawable to read an area from |
x : | the X coordinate to read the area from relative to the drawable |
y : | the Y coordinate to read the area from relative to the drawable |
width : | the width of the area to read |
height : | the height of the area to read |
pixels : | pointer to an area of memory to place the pixel data in |
void GrArea ( |
Draws the specified pixel array of the specified size and format onto the specified drawable using the specified graphics context at the specified position. Note that colour conversion is currently only performed when using the GR_PF_RGB format, which is an unsigned long containing RGBX data.
id : | the ID of the drawable to draw the area onto |
gc : | the ID of the graphics context to use when drawing the area |
x : | the X coordinate to draw the area at relative to the drawable |
y : | the Y coordinate to draw the area at relative to the drawable |
width : | the width of the area |
height : | the height of the area |
pixels : | pointer to an array containing the pixel data |
pixtype : | the format of the pixel data |
void GrCopyArea ( |
Copies the specified area of the specified size between the specified drawables at the specified positions using the specified graphics context and ROP codes. 0 is a sensible default ROP code in most cases.
id : | the ID of the drawable to copy the area to |
gc : | the ID of the graphics context to use when copying the area |
x : | the X coordinate to copy the area to within the destination drawable |
y : | the Y coordinate to copy the area to within the destination drawable |
width : | the width of the area to copy |
height : | the height of the area to copy |
srcid : | the ID of the drawable to copy the area from |
srcx : | the X coordinate to copy the area from within the source drawable |
srcy : | the Y coordinate to copy the area from within the source drawable |
op : | the ROP codes to pass to the blitter when performing the copy |
void GrBitmap ( |
Draws the monochrome bitmap data provided in the bitmaptable argument at the specified position on the specified drawable using the specified graphics context. Note that the bitmap data should be an array of aligned 16 bit words. The usebackground flag in the graphics context specifies whether to draw the background colour wherever a bit value is zero.
id : | the ID of the drawable to draw the bitmap onto |
gc : | the ID of the graphics context to use when drawing the bitmap |
x : | the X coordinate to draw the bitmap at relative to the drawable |
y : | the Y coordinate to draw the bitmap at relative to the drawable |
width : | the width of the bitmap |
height : | the height of the bitmap |
imagebits : |
void GrFreeImage ( |
Destroys the specified image buffer and reclaims the memory used by it.
id : | ID of the image buffer to free |
void GrGetImageInfo ( |
Fills in the specified image information structure with the details of the specified image buffer.
id : | ID of an image buffer |
iip : | pointer to a GR_IMAGE_INFO structure |
void GrDrawImageFromFile ( |
Loads the specified image file and draws it at the specified position on the specified drawable using the specified graphics context. The width and height values specify the size of the image to draw- if the actual image is a different size, it will be scaled to fit. The image type is automatically detected using the magic numbers in the image header (ie. the filename extension is irrelevant). The currently supported image types include GIF, JPEG, Windows BMP, PNG, XPM, and both ascii and binary variants of PBM, PGM, and PPM. However the image types supported by a particular server depend on which image types were enabled in the server configuration at build time.
id : | the ID of the drawable to draw the image onto |
gc : | the ID of the graphics context to use when drawing the image |
x : | the X coordinate to draw the image at relative to the drawable |
y : | the Y coordinate to draw the image at relative to the drawable |
width : | the maximum image width |
height : | the maximum image height |
path : | string containing the filename of the image to load |
flags : | flags specific to the particular image loader |
|
Loads the specified image file into a newly created server image buffer and returns the ID of the buffer. The image type is automatically detected using the magic numbers in the image header (ie. the filename extension is irrelevant). The currently supported image types include GIF, JPEG, Windows BMP, PNG, XPM, and both ascii and binary variants of PBM, PGM, and PPM. However the image types supported by a particular server depend on which image types were enabled in the server configuration at build time.
path : | string containing the filename of the image to load |
flags : | flags specific to the particular image loader |
Returns : | ID of the image buffer the image was loaded into |
void GrDrawImageToFit ( |
Draws the image from the specified image buffer at the specified position on the specified drawable using the specified graphics context. The width and height values specify the size of the image to draw- if the actual image is a different size, it will be scaled to fit.
id : | the ID of the drawable to draw the image onto |
gc : | the ID of the graphics context to use when drawing the image |
x : | the X coordinate to draw the image at relative to the drawable |
y : | the Y coordinate to draw the image at relative to the drawable |
width : | the maximum image width |
height : | the maximum image height |
imageid : | the ID of the image buffer containing the image to display |
void GrDrawImageBits ( |
Draws the image contained in the specified image structure onto the specified drawable at the specified coordinates using the specified graphics context.
id : | the ID of the drawable to draw the image onto |
gc : | the ID of the graphics context to use when drawing the image |
x : | the X coordinate to draw the image at relative to the drawable |
y : | the Y coordinate to draw the image at relative to the drawable |
pimage : | pointer to the image structure |
void GrText ( |
Draws the specified text string at the specified position on the specified drawable using the specified graphics context and flags. The default flags specify ASCII encoding and baseline alignment.
id : | the ID of the drawable to draw the text string onto |
gc : | the ID of the graphics context to use when drawing the text string |
x : | the X coordinate to draw the string at relative to the drawable |
y : | the Y coordinate to draw the string at relative to the drawable |
str : | the text string to draw |
count : | the number of characters (not bytes) in the string |
flags : | flags specifying text encoding, alignment, etc. |