mikroSDK Reference Manual
|
Shape Drawing API. More...
Functions list | |
void | gl_draw_rect (gl_coord_t top_left_x, gl_coord_t top_left_y, gl_uint_t width, gl_uint_t height) |
Draw a rectangle on display. More... | |
void | gl_draw_rect_rounded (gl_coord_t top_left_x, gl_coord_t top_left_y, gl_uint_t width, gl_uint_t height, gl_uint_t radius) |
Draw a rounded rectangle on display. More... | |
void | gl_draw_point (gl_coord_t x, gl_coord_t y) |
Draw a point on display. More... | |
void | gl_draw_line (gl_coord_t x1, gl_coord_t y1, gl_coord_t x2, gl_coord_t y2) |
Draw a line on the display. More... | |
void | gl_draw_circle (gl_coord_t x0, gl_coord_t y0, gl_uint_t radius) |
Draw a circle on display. More... | |
void | gl_draw_ellipse (gl_coord_t x0, gl_coord_t y0, gl_uint_t half_a, gl_uint_t half_b) |
Draw ellipse to the display driver using previously set pen and brush. More... | |
void | gl_draw_arc (gl_coord_t x, gl_coord_t y, gl_uint_t radius, gl_angle_t start, gl_angle_t end) |
Draw an arc on display. More... | |
This API is used for drawing and managing shapes on the display.
void gl_draw_rect | ( | gl_coord_t | top_left_x, |
gl_coord_t | top_left_y, | ||
gl_uint_t | width, | ||
gl_uint_t | height | ||
) |
This function draws a rectangle on a display with top left corner positioned at top_left_x
and top_left_y
coordinates using pen and brush previously set. Coordinates are represented by a special type gl_coord_t. Look of the rectangle can be customized using different pen and brush. To see how they can be set, please see Basic Library Configuration.
[in] | top_left_x | X coordinate of rectangle's top left corner. |
[in] | top_left_y | Y coordinate of rectangle's top left corner. |
[in] | width | Width of rectangle. |
[in] | height | Height of rectangle. |
Example
void gl_draw_rect_rounded | ( | gl_coord_t | top_left_x, |
gl_coord_t | top_left_y, | ||
gl_uint_t | width, | ||
gl_uint_t | height, | ||
gl_uint_t | radius | ||
) |
This function draws a rounded rectangle on a display using previously set pen and brush. Coordinates are represented by a special type gl_coord_t. Look of the rounded rectangle can be customized using different pen and brush. To see how they can be set, please see Basic Library Configuration.
[in] | top_left_x | X coordinate of rectangle's top left corner. |
[in] | top_left_y | Y coordinate of rectangle's top left corner. |
[in] | width | Width of the rectangle. |
[in] | height | Height of the rectangle. |
[in] | radius | Radius of rounded corners. |
Example
void gl_draw_point | ( | gl_coord_t | x, |
gl_coord_t | y | ||
) |
This function draws point on a display using previously set pen. Coordinates are represented by a special type gl_coord_t. Look of the point can be customized using different pen. To see how it can be set, please see Basic Library Configuration.
[in] | x | X coordinate of the point. |
[in] | y | Y coordinate of the point. |
Example
void gl_draw_line | ( | gl_coord_t | x1, |
gl_coord_t | y1, | ||
gl_coord_t | x2, | ||
gl_coord_t | y2 | ||
) |
This function draws a A-B line on a display using previously set pen. Coordinates are represented by a special type gl_coord_t. Look of the line can be customized using different pen. To see how it can be set, please see Basic Library Configuration.
[in] | x1 | X coordinate of point A. |
[in] | y1 | Y coordinate of point A. |
[in] | x2 | X coordinate of point B. |
[in] | y2 | Y coordinate of point B. |
Example
void gl_draw_circle | ( | gl_coord_t | x0, |
gl_coord_t | y0, | ||
gl_uint_t | radius | ||
) |
This function draws a circle on a display using previously set pen and brush. Coordinates are represented by a special type gl_coord_t. Look of the circle can be customized using different pen and brush. To see how they can be set, please see Basic Library Configuration.
[in] | x0 | X coordinate of center. |
[in] | y0 | Y coordinate of center. |
[in] | radius | Circle radius. |
Example
void gl_draw_ellipse | ( | gl_coord_t | x0, |
gl_coord_t | y0, | ||
gl_uint_t | half_a, | ||
gl_uint_t | half_b | ||
) |
Coordinates are represented by special type gl_coord_t. Look of the shape can be cusomized using different pen and brush. To see how they can be set, visit gl.h .
[in] | x0 | X coordinate of the center. |
[in] | y0 | Y coordinate of the center. |
[in] | half_a | Semi-length on the X axis. |
[in] | half_b | Semi-length on the Y axis. |
void gl_draw_arc | ( | gl_coord_t | x, |
gl_coord_t | y, | ||
gl_uint_t | radius, | ||
gl_angle_t | start, | ||
gl_angle_t | end | ||
) |
This function draws an arc on a display with center in x
and y
coordinates and radius size . The start (end) of the arc is determined by
start
(end
) angle made with x axis. Coordinates are represented by a special type gl_coord_t. Look of the arc can be customized using different pen and brush. To see how they can be set, please see Basic Library Configuration. If any of the given angles are over 360, angle will be recalculated as modulo 360.
[in] | x | X coordinate of center. |
[in] | y | y coordinate of center. |
[in] | radius | radius of arc. |
[in] | start | the angle made with x axis which determines where the arc stars. |
[in] | end | the angle made withh x axis which determines where the arc ends. |
Example