Drawing in user coordinates

Drawing in user coordinates — Drawing in user window coordinates

Functions

void grx_user_set_window ()
void grx_user_get_window ()
void grx_user_convert_user_to_screen ()
void grx_user_convert_screen_to_user ()
void grx_user_draw_pixel ()
void grx_user_draw_line ()
void grx_user_draw_hline ()
void grx_user_draw_vline ()
void grx_user_draw_box ()
void grx_user_draw_circle ()
void grx_user_draw_ellipse ()
void grx_user_draw_circle_arc ()
void grx_user_draw_ellipse_arc ()
void grx_user_draw_polyline ()
void grx_user_draw_polygon ()
void grx_user_draw_filled_box ()
void grx_user_draw_framed_box ()
void grx_user_draw_filled_circle ()
void grx_user_draw_filled_ellipse ()
void grx_user_draw_filled_circle_arc ()
void grx_user_draw_filled_ellipse_arc ()
void grx_user_draw_filled_polygon ()
void grx_user_draw_filled_convex_polygon ()
void grx_user_flood_fill ()
GrxColor grx_user_get_pixel_at ()
GrxColor grx_context_get_pixel_at_user ()
void grx_user_draw_line_with_options ()
void grx_user_draw_box_with_options ()
void grx_user_draw_circle_with_options ()
void grx_user_draw_ellipse_with_options ()
void grx_user_draw_circle_arc_with_options ()
void grx_user_draw_ellipse_arc_with_options ()
void grx_user_draw_polyline_with_options ()
void grx_user_draw_polygon_with_options ()
void grx_user_draw_line_with_pixmap ()
void grx_user_draw_box_with_pixmap ()
void grx_user_draw_circle_with_pixmap ()
void grx_user_draw_ellipse_with_pixmap ()
void grx_user_draw_circle_arc_with_pixmap ()
void grx_user_draw_ellipse_arc_with_pixmap ()
void grx_user_draw_polyline_with_pixmap ()
void grx_user_draw_polygon_with_pixmap ()
void grx_user_draw_filled_pixel_with_pixmap ()
void grx_user_draw_filled_line_with_pixmap ()
void grx_user_draw_filled_box_with_pixmap ()
void grx_user_draw_filled_circle_with_pixmap ()
void grx_user_draw_filled_ellipse_with_pixmap ()
void grx_user_draw_filled_circle_arc_with_pixmap ()
void grx_user_draw_filled_ellipse_arc_with_pixmap ()
void grx_user_draw_filled_polygon_with_pixmap ()
void grx_user_draw_filled_convex_polygon_with_pixmap ()
void grx_user_flood_fill_with_pixmap ()
void grx_user_draw_text ()

Includes

#include <grx-3.0.h>

Description

There is a second set of the graphics primitives which operates in user coordinates. Every context has a user to screen coordinate mapping associated with it.

If an application wants to take advantage of the user to screen coordinate mapping it has to use the user coordinate version of the graphics primitives. These have exactly the same parameter passing conventions as their screen coordinate counterparts. NOTE: the user coordinate system is not initialized by the library! The application has to set up its coordinate mapping before calling any of the use coordinate drawing functions – otherwise the program will almost certainly exit (in a quite ungraceful fashion) with a 'division by zero' error.

Functions

grx_user_set_window ()

void
grx_user_set_window (gint x1,
                     gint y1,
                     gint x2,
                     gint y2);

Specifies the user window.

A call to this function it in fact specifies the virtual coordinate limits which will be mapped onto the current context regardless of the size of the context. For example, the call:

GrSetUserWindow(0,0,11999,8999);

tells the library that the program will perform its drawing operations in a coordinate system X:0...11999 (width = 12000) and Y:0...8999 (height = 9000). This coordinate range will be mapped onto the total area of the current context. The virtual coordinate system can also be shifted. For example:

GrSetUserWindow(5000,2000,16999,10999);

The user coordinates can even be used to turn the usual left-handed coordinate system (0:0 corresponds to the upper left corner) to a right handed one (0:0 corresponds to the bottom left corner) by calling:

GrSetUserWindow(0,8999,11999,0);

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

grx_user_get_window ()

void
grx_user_get_window (gint *x1,
                     gint *y1,
                     gint *x2,
                     gint *y2);

Gets the user window of the current context.

Parameters

x1

the left X coordinate.

[out]

y1

the top Y coordinate.

[out]

x2

the right X coordinate.

[out]

y2

the bottom Y coordinate.

[out]

grx_user_convert_user_to_screen ()

void
grx_user_convert_user_to_screen (gint *x,
                                 gint *y);

Converts x and y from coordinates in the user window to coordinates in the current context.

Parameters

x

the X coordinate.

[inout]

y

the Y coordinate.

[inout]

grx_user_convert_screen_to_user ()

void
grx_user_convert_screen_to_user (gint *x,
                                 gint *y);

Converts x and y from coordinates in the current context to coordinates in the user window.

Parameters

x

the X coordinate.

[inout]

y

the Y coordinate.

[inout]

grx_user_draw_pixel ()

void
grx_user_draw_pixel (gint x,
                     gint y,
                     GrxColor c);

Draw a single pixel on the current context at the specified user coordinates.

Parameters

x

the X coordinate

 

y

the Y coordinate

 

c

the color (can include GrxColorMode)

 

grx_user_draw_line ()

void
grx_user_draw_line (gint x1,
                    gint y1,
                    gint x2,
                    gint y2,
                    GrxColor c);

Draws a line on the current context from the starting coordinates to the ending coordinates using the specified color.

For horizontal and vertical lines, see grx_user_draw_hline() and grx_user_draw_vline().

Parameters

x1

starting X coordinate

 

y1

starting Y coordinate

 

x2

ending X coordinate

 

y2

ending Y coordinate

 

c

the color

 

grx_user_draw_hline ()

void
grx_user_draw_hline (gint x1,
                     gint x2,
                     gint y,
                     GrxColor c);

Draws a horizontal line on the current context from the starting coordinates to the ending coordinates using the specified color.

This is more efficient that using grx_user_draw_line().

Parameters

x1

starting X coordinate

 

x2

ending X coordinate

 

y

Y coordinate

 

c

the color

 

grx_user_draw_vline ()

void
grx_user_draw_vline (gint x,
                     gint y1,
                     gint y2,
                     GrxColor c);

Draws a vertical line on the current context from the starting coordinates to the ending coordinates using the specified color.

This is more efficient that using grx_user_draw_line().

Parameters

x

X coordinate

 

y1

starting Y coordinate

 

y2

ending Y coordinate

 

c

the color

 

grx_user_draw_box ()

void
grx_user_draw_box (gint x1,
                   gint y1,
                   gint x2,
                   gint y2,
                   GrxColor c);

Draws a rectangle on the current context using the specified coordinates and color.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

c

the color

 

grx_user_draw_circle ()

void
grx_user_draw_circle (gint xc,
                      gint yc,
                      gint r,
                      GrxColor c);

Draws a circle on the current context centered at the specified coordinates with the specified radius and color.

Parameters

xc

the X coordinate of the center of the circle

 

yc

the Y coordinate of the center of the circle

 

r

the radius of the circle

 

c

the color

 

grx_user_draw_ellipse ()

void
grx_user_draw_ellipse (gint xc,
                       gint yc,
                       gint rx,
                       gint ry,
                       GrxColor c);

Draws an ellipse on the current context using the specified color.

The ellipse can only draw ellipses with its major axis parallel with either the X or Y coordinate axis

Parameters

xc

the X coordinate of the center of the ellipse

 

yc

the Y coordinate of the center of the ellipse

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

c

the color

 

grx_user_draw_circle_arc ()

void
grx_user_draw_circle_arc (gint xc,
                          gint yc,
                          gint r,
                          gint start,
                          gint end,
                          GrxArcStyle style,
                          GrxColor c);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radius, arc style and color.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

r

the radius of the arc

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

c

the color

 

grx_user_draw_ellipse_arc ()

void
grx_user_draw_ellipse_arc (gint xc,
                           gint yc,
                           gint rx,
                           gint ry,
                           gint start,
                           gint end,
                           GrxArcStyle style,
                           GrxColor c);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radii, arc style and color.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

c

the color

 

grx_user_draw_polyline ()

void
grx_user_draw_polyline (gint n_points,
                        GrxPoint *points,
                        GrxColor c);

Draw a multi-segment line on the current context that connects each point in the points array using the specified color.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

c

the color

 

grx_user_draw_polygon ()

void
grx_user_draw_polygon (gint n_points,
                       GrxPoint *points,
                       GrxColor c);

Draw a closed polygon on the current context that connects each point in the points array using the specified color.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

c

the color

 

grx_user_draw_filled_box ()

void
grx_user_draw_filled_box (gint x1,
                          gint y1,
                          gint x2,
                          gint y2,
                          GrxColor c);

Draws a filled rectangle on the current context using the specified coordinates and color.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

c

the color

 

grx_user_draw_framed_box ()

void
grx_user_draw_framed_box (gint x1,
                          gint y1,
                          gint x2,
                          gint y2,
                          gint width,
                          GrxFramedBoxColors *c);

Draws a framed rectangle on the current context using the specified coordinates and colors. The coordinates specify the interior box. The border extends outside of the box using the given width .

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

width

the width of the frame

 

c

the colors

 

grx_user_draw_filled_circle ()

void
grx_user_draw_filled_circle (gint xc,
                             gint yc,
                             gint r,
                             GrxColor c);

Draws a filled circle on the current context centered at the specified coordinates with the specified radius and color.

Parameters

xc

the X coordinate of the center of the circle

 

yc

the Y coordinate of the center of the circle

 

r

the radius of the circle

 

c

the color

 

grx_user_draw_filled_ellipse ()

void
grx_user_draw_filled_ellipse (gint xc,
                              gint yc,
                              gint rx,
                              gint ry,
                              GrxColor c);

Draws a filled ellipse on the current context using the specified color.

The ellipse can only draw ellipses with its major axis parallel with either the X or Y coordinate axis

Parameters

xc

the X coordinate of the center of the ellipse

 

yc

the Y coordinate of the center of the ellipse

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

c

the color

 

grx_user_draw_filled_circle_arc ()

void
grx_user_draw_filled_circle_arc (gint xc,
                                 gint yc,
                                 gint r,
                                 gint start,
                                 gint end,
                                 GrxArcStyle style,
                                 GrxColor c);

Draws a filled arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radius, arc style and color.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

r

the radius of the arc

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

c

the color

 

grx_user_draw_filled_ellipse_arc ()

void
grx_user_draw_filled_ellipse_arc (gint xc,
                                  gint yc,
                                  gint rx,
                                  gint ry,
                                  gint start,
                                  gint end,
                                  GrxArcStyle style,
                                  GrxColor c);

Draws a filled arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radii, arc style and color.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

c

the color

 

grx_user_draw_filled_polygon ()

void
grx_user_draw_filled_polygon (gint n_points,
                              GrxPoint *points,
                              GrxColor c);

Draw a filled polygon on the current context that connects each point in the points array using the specified color.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

c

the color

 

grx_user_draw_filled_convex_polygon ()

void
grx_user_draw_filled_convex_polygon (gint n_points,
                                     GrxPoint *points,
                                     GrxColor c);

Draw a filled polygon on the current context that connects each point in the points array using the specified color.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

This version is slightly more efficient that grx_draw_filled_polygon() but requires that the polygon is convex. It can also be used to fill some concave polygons whose boundaries do not intersect any horizontal scan line more than twice. It can also be used to fill several disjoint nonoverlapping polygons in a single operation.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

c

the color

 

grx_user_flood_fill ()

void
grx_user_flood_fill (gint x,
                     gint y,
                     GrxColor border,
                     GrxColor c);

Flood-fills the area of the current context bounded by the color border using x , y as the starting point.

Parameters

x

the starting X coordinate

 

y

the starting Y coordinate

 

border

the color of the border that contains the fill

 

c

the color of the fill

 

grx_user_get_pixel_at ()

GrxColor
grx_user_get_pixel_at (gint x,
                       gint y);

Gets the color value of the pixel in the current context at the specified coordinates.

Parameters

x

the X coordinate

 

y

the Y coordinate

 

grx_context_get_pixel_at_user ()

GrxColor
grx_context_get_pixel_at_user (GrxContext *context,
                               gint x,
                               gint y);

Gets the color value of the pixel in the context at the specified coordinates.

Also see grx_get_pixel_at() for operating on the current context.

Parameters

context

the context

 

x

the X coordinate

 

y

the Y coordinate

 

grx_user_draw_line_with_options ()

void
grx_user_draw_line_with_options (gint x1,
                                 gint y1,
                                 gint x2,
                                 gint y2,
                                 const GrxLineOptions *o);

Draws a line on the current context from the starting coordinates to the ending coordinates using the specified options.

Parameters

x1

starting X coordinate

 

y1

starting Y coordinate

 

x2

ending X coordinate

 

y2

ending Y coordinate

 

o

the options

 

grx_user_draw_box_with_options ()

void
grx_user_draw_box_with_options (gint x1,
                                gint y1,
                                gint x2,
                                gint y2,
                                const GrxLineOptions *o);

Draws a rectangle on the current context using the specified coordinates and options.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

o

the options

 

grx_user_draw_circle_with_options ()

void
grx_user_draw_circle_with_options (gint xc,
                                   gint yc,
                                   gint r,
                                   const GrxLineOptions *o);

Draws a circle on the current context centered at the specified coordinates with the specified radius and options.

Parameters

xc

the X coordinate of the center of the circle

 

yc

the Y coordinate of the center of the circle

 

r

the radius of the circle

 

o

the options

 

grx_user_draw_ellipse_with_options ()

void
grx_user_draw_ellipse_with_options (gint xc,
                                    gint yc,
                                    gint rx,
                                    gint ry,
                                    const GrxLineOptions *o);

Draws an ellipse on the current context using the specified options.

The ellipse can only draw ellipses with its major axis parallel with either the X or Y coordinate axis

Parameters

xc

the X coordinate of the center of the ellipse

 

yc

the Y coordinate of the center of the ellipse

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

o

the options

 

grx_user_draw_circle_arc_with_options ()

void
grx_user_draw_circle_arc_with_options (gint xc,
                                       gint yc,
                                       gint r,
                                       gint start,
                                       gint end,
                                       GrxArcStyle style,
                                       const GrxLineOptions *o);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radius, arc style and options.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

r

the radius of the arc

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

o

the options

 

grx_user_draw_ellipse_arc_with_options ()

void
grx_user_draw_ellipse_arc_with_options
                               (gint xc,
                                gint yc,
                                gint rx,
                                gint ry,
                                gint start,
                                gint end,
                                GrxArcStyle style,
                                const GrxLineOptions *o);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radii, arc style and options.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

o

the options

 

grx_user_draw_polyline_with_options ()

void
grx_user_draw_polyline_with_options (gint n_points,
                                     GrxPoint *points,
                                     const GrxLineOptions *o);

Draw a multi-segment line on the current context that connects each point in the points array using the specified options.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

o

the options

 

grx_user_draw_polygon_with_options ()

void
grx_user_draw_polygon_with_options (gint n_points,
                                    GrxPoint *points,
                                    const GrxLineOptions *o);

Draw a closed polygon on the current context that connects each point in the points array using the specified options.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

o

the options

 

grx_user_draw_line_with_pixmap ()

void
grx_user_draw_line_with_pixmap (gint x1,
                                gint y1,
                                gint x2,
                                gint y2,
                                GrxLineOptions *o,
                                GrxPixmap *p);

Draws a line on the current context from the starting coordinates to the ending coordinates using the specified line options and pixmap.

Parameters

x1

starting X coordinate

 

y1

starting Y coordinate

 

x2

ending X coordinate

 

y2

ending Y coordinate

 

o

the line options

 

p

the pixmap

 

grx_user_draw_box_with_pixmap ()

void
grx_user_draw_box_with_pixmap (gint x1,
                               gint y1,
                               gint x2,
                               gint y2,
                               GrxLineOptions *o,
                               GrxPixmap *p);

Draws a rectangle on the current context using the specified coordinates and line options and pixmap.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

o

the line options

 

p

the pixmap

 

grx_user_draw_circle_with_pixmap ()

void
grx_user_draw_circle_with_pixmap (gint xc,
                                  gint yc,
                                  gint r,
                                  GrxLineOptions *o,
                                  GrxPixmap *p);

Draws a circle on the current context centered at the specified coordinates with the specified radius and line options and pixmap.

Parameters

xc

the X coordinate of the center of the circle

 

yc

the Y coordinate of the center of the circle

 

r

the radius of the circle

 

o

the line options

 

p

the pixmap

 

grx_user_draw_ellipse_with_pixmap ()

void
grx_user_draw_ellipse_with_pixmap (gint xc,
                                   gint yc,
                                   gint rx,
                                   gint ry,
                                   GrxLineOptions *o,
                                   GrxPixmap *p);

Draws an ellipse on the current context using the specified line options and pattern.

The ellipse can only draw ellipses with its major axis parallel with either the X or Y coordinate axis

Parameters

xc

the X coordinate of the center of the ellipse

 

yc

the Y coordinate of the center of the ellipse

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

o

the line options

 

p

the pixmap

 

grx_user_draw_circle_arc_with_pixmap ()

void
grx_user_draw_circle_arc_with_pixmap (gint xc,
                                      gint yc,
                                      gint r,
                                      gint start,
                                      gint end,
                                      GrxArcStyle style,
                                      GrxLineOptions *o,
                                      GrxPixmap *p);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radius, arc style and line options and pixmap.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

r

the radius of the arc

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

o

the line options

 

p

the pixmap

 

grx_user_draw_ellipse_arc_with_pixmap ()

void
grx_user_draw_ellipse_arc_with_pixmap (gint xc,
                                       gint yc,
                                       gint rx,
                                       gint ry,
                                       gint start,
                                       gint end,
                                       GrxArcStyle style,
                                       GrxLineOptions *o,
                                       GrxPixmap *p);

Draws an arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radii, arc style and line options and pixmap.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

o

the line options

 

p

the pixmap

 

grx_user_draw_polyline_with_pixmap ()

void
grx_user_draw_polyline_with_pixmap (gint n_points,
                                    GrxPoint *points,
                                    GrxLineOptions *o,
                                    GrxPixmap *p);

Draw a multi-segment line on the current context that connects each point in the points array using the specified line options and pattern.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

o

the line options

 

p

the pixmap

 

grx_user_draw_polygon_with_pixmap ()

void
grx_user_draw_polygon_with_pixmap (gint n_points,
                                   GrxPoint *points,
                                   GrxLineOptions *o,
                                   GrxPixmap *p);

Draw a closed polygon on the current context that connects each point in the points array using the specified line options and pixmap.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

o

the line options

 

p

the pixmap

 

grx_user_draw_filled_pixel_with_pixmap ()

void
grx_user_draw_filled_pixel_with_pixmap
                               (gint x,
                                gint y,
                                GrxPixmap *p);

Draw a single pixel on the current context at the specified coordinates.

Parameters

x

the X coordinate

 

y

the Y coordinate

 

p

the pixmap

 

grx_user_draw_filled_line_with_pixmap ()

void
grx_user_draw_filled_line_with_pixmap (gint x1,
                                       gint y1,
                                       gint x2,
                                       gint y2,
                                       GrxPixmap *p);

Draws a line on the current context from the starting coordinates to the ending coordinates using the specified pixmap.

For horizontal and vertical lines, see grx_draw_hline() and grx_draw_vline().

Parameters

x1

starting X coordinate

 

y1

starting Y coordinate

 

x2

ending X coordinate

 

y2

ending Y coordinate

 

p

the pixmap

 

grx_user_draw_filled_box_with_pixmap ()

void
grx_user_draw_filled_box_with_pixmap (gint x1,
                                      gint y1,
                                      gint x2,
                                      int y2,
                                      GrxPixmap *p);

Draws a filled rectangle on the current context using the specified coordinates and pixmap.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

p

the pixmap

 

grx_user_draw_filled_circle_with_pixmap ()

void
grx_user_draw_filled_circle_with_pixmap
                               (gint xc,
                                gint yc,
                                gint r,
                                GrxPixmap *p);

Draws a filled circle on the current context centered at the specified coordinates with the specified radius and pixmap.

Parameters

xc

the X coordinate of the center of the circle

 

yc

the Y coordinate of the center of the circle

 

r

the radius of the circle

 

p

the pixmap

 

grx_user_draw_filled_ellipse_with_pixmap ()

void
grx_user_draw_filled_ellipse_with_pixmap
                               (gint xc,
                                gint yc,
                                gint rx,
                                gint ry,
                                GrxPixmap *p);

Draws a filled ellipse on the current context using the specified pixmap.

The ellipse can only draw ellipses with its major axis parallel with either the X or Y coordinate axis

Parameters

xc

the X coordinate of the center of the ellipse

 

yc

the Y coordinate of the center of the ellipse

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

p

the pixmap

 

grx_user_draw_filled_circle_arc_with_pixmap ()

void
grx_user_draw_filled_circle_arc_with_pixmap
                               (gint xc,
                                gint yc,
                                gint r,
                                gint start,
                                gint end,
                                GrxArcStyle style,
                                GrxPixmap *p);

Draws a filled arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radius, arc style and pixmap.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

r

the radius of the arc

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

p

the pixmap

 

grx_user_draw_filled_ellipse_arc_with_pixmap ()

void
grx_user_draw_filled_ellipse_arc_with_pixmap
                               (gint xc,
                                gint yc,
                                gint rx,
                                gint ry,
                                gint start,
                                gint end,
                                GrxArcStyle style,
                                GrxPixmap *p);

Draws a filled arc on the current context centered at the specified coordinates from the starting angle to the ending angle with the specified radii, arc style and pixmap.

Parameters

xc

the X coordinate of the center of the arc

 

yc

the Y coordinate of the center of the arc

 

rx

the radius in the X direction

 

ry

the radius in the Y direction

 

start

the starting angle in 1/10ths of degrees

 

end

the ending angle in 1/10ths of degrees

 

style

the arc style

 

p

the pixmap

 

grx_user_draw_filled_polygon_with_pixmap ()

void
grx_user_draw_filled_polygon_with_pixmap
                               (gint n_points,
                                GrxPoint *points,
                                GrxPixmap *p);

Draw a filled polygon on the current context that connects each point in the points array using the specified pixmap.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

p

the pixmap

 

grx_user_draw_filled_convex_polygon_with_pixmap ()

void
grx_user_draw_filled_convex_polygon_with_pixmap
                               (gint n_points,
                                GrxPoint *points,
                                GrxPixmap *p);

Draw a filled polygon on the current context that connects each point in the points array using the specified pixmap.

Coordinate arrays can either contain or omit the closing edge of the polygon. It will be automatically appended to the list if it is missing.

This version is slightly more efficient that grx_draw_filled_polygon() but requires that the polygon is convex. It can also be used to fill some concave polygons whose boundaries do not intersect any horizontal scan line more than twice. It can also be used to fill several disjoint nonoverlapping polygons in a single operation.

Parameters

n_points

the number of points in points

 

points

an array of GrxPoint.

[array length=n_points]

p

the pixmap

 

grx_user_flood_fill_with_pixmap ()

void
grx_user_flood_fill_with_pixmap (gint x,
                                 gint y,
                                 GrxColor border,
                                 GrxPixmap *p);

Flood-fills the area of the current context bounded by the color border using x , y as the starting point.

Parameters

x

the starting X coordinate

 

y

the starting Y coordinate

 

border

the color of the border that contains the fill

 

p

the pixmap of the fill

 

grx_user_draw_text ()

void
grx_user_draw_text (const gchar *text,
                    gint x,
                    gint y,
                    GrxTextOptions *options);

Types and Values