CanvasImageModel


Description:

[ CCode ( has_construct_function = false , type = "GooCanvasItemModel*" ) ]
public CanvasImageModel (CanvasItemModel? parent, Pixbuf? pixbuf, double x, double 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:

<informalexample><programlisting> GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, NULL); </programlisting></informalexample>

This example creates an image scaled to a size of 200x200:

<informalexample><programlisting> GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, "width", 200.0, "height", 200.0, "scale-to-fit", TRUE, NULL); </programlisting></informalexample>

Parameters:

parent

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 unref to free it.

pixbuf

the Pixbuf containing the image data, or null.

x

the x coordinate of the image.

y

the y coordinate of the image.

...

optional pairs of property names and values, and a terminating null.

Returns:

a new image model.




2022 vala-language.org