Home| base |src.lib|graphic|fbuffer| FrameBufferRectangle Index

FrameBufferRectangle

Syntax
int FrameBufferRectangle(struct FrameBuffer *ptr, struct FrameBufferMatrix *matrix, int x,int y,int w,int h, int fill,unsigned int color,unsigned char m, int width, struct FrameBufferDash *dash, struct FrameBufferClip *clip);
Header
base/rfbuffer.h
Library
rfbuf
Description

The FrameBufferRectangle function plots a rectangle.

The argument ptr is a pointer to the frame buffer. The argument matrix is an optional transformation matrix that can be applied to the rectangle. If this is set to a NULL pointer then no transformation is applied. The position at which the rectangle is plotted is given by the arguments x, and y. The width and height of the rectangle are given by the arguments w and h.

If the argument fill is set to a non-zero value then the rectangle will be plotted as a solid shape, not an outline.

The color used to plot the rectangle is given by the color which is a 32-bit number that represents the alpha,red,green and blue components of the color as 8-bit number. The alpha channel occupies the most significant bits and the blue channel occupies the least significant bits. The argument mask defines which color channels are active. Setting this argument to (0x0f) will output the color to all four channels. The most significant bit controls the alpha channel and the least significant bit controls the blue channel.

The width of the line used to plot the rectangle is controlled using the argument width, a value of zero will plot a hairline. The dot-dash pattern used to plot the rectangle is given by dash. If this is set to a NULL pointer, a solid line is plotted.

The clipping polygon is given by the argument clip. If this is set to a NULL pointer, no clipping is performed.

Returns
Returns zero on success. On error, (-1) is returned.
Errors
Returns zero on success. On error, (-1) is returned.
Example
None