| GooCanvas Reference Manual | ||||
|---|---|---|---|---|
#include <goocanvas.h>
GooCanvasImage;
GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent,
GdkPixbuf *pixbuf,
gdouble x,
gdouble y,
const gchar *first_property,
...);
"height" gdouble : Read / Write "pattern" GooCairoPattern : Read / Write "pixbuf" GdkPixbuf : Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write
GooCanvasImage represents an image item.
It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "operator" and "pointer-events".
It also implements the GooCanvasItem interface, so you can use the
GooCanvasItem functions such as goo_canvas_item_raise() and
goo_canvas_item_rotate().
To create a GooCanvasImage use goo_canvas_image_new().
To get or set the properties of an existing GooCanvasImage, use
g_object_get() and g_object_set().
To respond to events such as mouse clicks on the image you must connect
to the signal handlers of the corresponding GooCanvasImageView objects.
(See goo_canvas_view_get_item_view() and GooCanvasView::item-view-created.)
typedef struct _GooCanvasImage GooCanvasImage;
The GooCanvasImage struct contains private data only.
GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, const gchar *first_property, ...);
Creates a new image item.
parent : |
the parent item, or NULL. If a parent is specified, it will assume
ownership of the item, and the item will automatically be freed when it is
removed from the parent. Otherwise call g_object_unref() to free it.
|
pixbuf : |
the GdkPixbuf containing the image data, or NULL.
|
x : |
the x coordinate of the image. |
y : |
the y coordinate of the image. |
first_property : |
the name of the first property to set, or NULL.
|
... : |
the remaining property names and values to set, terminated with a
NULL.
|
| Returns : | a new image item. |
Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height:
GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
NULL);