Top | ![]() |
![]() |
![]() |
![]() |
gdouble | alpha | Read / Write |
gdouble | height | Read / Write |
GooCairoPattern * | pattern | Read / Write |
GdkPixbuf * | pixbuf | Write |
gboolean | scale-to-fit | Read / Write |
gdouble | width | Read / Write |
gdouble | x | Read / Write |
gdouble | y | Read / Write |
GooCanvasImageModel represent a model for image items.
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”.)
GooCanvasItemModel * goo_canvas_image_model_new (GooCanvasItemModel *parent
,GdkPixbuf *pixbuf
,gdouble x
,gdouble y
,...
);
Creates a new image model.
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); |
parent |
the parent model, or |
|
pixbuf |
the GdkPixbuf containing the image data, or |
|
x |
the x coordinate of the image. |
|
y |
the y coordinate of the image. |
struct GooCanvasImageModel;
The GooCanvasImageModel struct contains private data only.
“alpha”
property “alpha” gdouble
The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque.
Flags: Read / Write
Allowed values: [0,1]
Default value: 1
“height”
property “height” gdouble
The height of the image.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“scale-to-fit”
property “scale-to-fit” gboolean
If the image is scaled to fit the width and height settings.
Flags: Read / Write
Default value: FALSE
“width”
property “width” gdouble
The width of the image.
Flags: Read / Write
Allowed values: >= 0
Default value: 0