Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ![]() |
![]() |
![]() |
![]() |
struct GooCanvasImageModel; GooCanvasItemModel * goo_canvas_image_model_new (GooCanvasItemModel *parent
,GdkPixbuf *pixbuf
,gdouble x
,gdouble y
,...
);
"alpha" gdouble : Read / Write "height" gdouble : Read / Write "pattern" GooCairoPattern* : Read / Write "pixbuf" GdkPixbuf* : Write "scale-to-fit" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write
GooCanvasImageModel represent a model for image items.
It is usually necessary to set the "scale-to-fit" property to TRUE
to
scale the image to fit the given rectangle. When using units other than
GTK_UNIT_PIXEL
it is also necessary to set the "width" and "height"
properties to set the desired size.
It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "operator" and "pointer-events".
It also implements the GooCanvasItemModel interface, so you can use the
GooCanvasItemModel functions such as goo_canvas_item_model_raise()
and
goo_canvas_item_model_rotate()
.
To create a GooCanvasImageModel use goo_canvas_image_model_new()
.
To get or set the properties of an existing GooCanvasImageModel, 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 GooCanvasImage objects.
(See goo_canvas_get_item()
and "item-created".)
struct GooCanvasImageModel;
The GooCanvasImageModel struct contains private data only.
GooCanvasItemModel * goo_canvas_image_model_new (GooCanvasItemModel *parent
,GdkPixbuf *pixbuf
,gdouble x
,gdouble y
,...
);
Creates a new image model.
|
the parent model, 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. [skip]
|
|
the GdkPixbuf containing the image data, or NULL . [allow-none]
|
|
the x coordinate of the image. |
|
the y coordinate of the image. |
|
optional pairs of property names and values, and a terminating NULL . |
Returns : |
a new image model. [transfer full] |
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:
1 2 |
GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, NULL); |
This example creates an image scaled to a size of 200x200:
1 2 3 4 5 |
GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, "width", 200.0, "height", 200.0, "scale-to-fit", TRUE, NULL); |
"alpha"
property "alpha" gdouble : Read / Write
The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque.
Allowed values: [0,1]
Default value: 1
"height"
property "height" gdouble : Read / Write
The height of the image.
Allowed values: >= 0
Default value: 0
"scale-to-fit"
property "scale-to-fit" gboolean : Read / Write
If the image is scaled to fit the width and height settings.
Default value: FALSE
"width"
property "width" gdouble : Read / Write
The width of the image.
Allowed values: >= 0
Default value: 0