## GooCanvasImage GooCanvasImage — an image item. |

## Functions

GooCanvasItem * | goo_canvas_image_new ()

## Properties

double | alpha | Read / Write
double | height | Read / Write
GooCairoPattern * | pattern | Read / Write
GdkPixbuf * | pixbuf | Write
gboolean | scale-to-fit | Read / Write
double | width | Read / Write
double | x | Read / Write
double | y | Read / Write

## Types and Values

struct | GooCanvasImage

## Object Hierarchy

        GObject
        ╰── GooCanvasItemSimple
            ╰── GooCanvasImage

## Implemented Interfaces

GooCanvasImage implements GooCanvasItem.

## Description

GooCanvasImage represents an image item.

It is usually necessary to set the "scale-to-fit" property to `TRUE` to scale the image to fit the given rectangle.

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()`.

## Functions

### goo_canvas_image_new ()

    GooCanvasItem *
    goo_canvas_image_new (GooCanvasItem *parent,
                          GdkPixbuf *pixbuf,
                          gdouble x,
                          gdouble y,
                          ...);

Creates 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:

    1
    2
    GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
                                                 NULL);

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

    1
    2
    3
    4
    5
    GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
                                                 "width", 200.0,
                                                 "height", 200.0,
                                                 "scale-to-fit", TRUE,
                                                 NULL);

#### Parameters

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. | [skip]
pixbuf | the GdkPixbuf containing the image data, or `NULL`. | [allow-none]
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 item.

[transfer full]

## Types and Values

### struct GooCanvasImage

    struct GooCanvasImage;

The GooCanvasImage struct contains private data only.

## Property Details

### The `“alpha”` property

      “alpha”                    double

The opacity of the image, 0.0 is fully transparent, and 1.0 is opaque.

Owner: GooCanvasImage

Flags: Read / Write

Allowed values: [0,1]

Default value: 1

### The `“height”` property

      “height”                   double

The height of the image.

Owner: GooCanvasImage

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“pattern”` property

      “pattern”                  GooCairoPattern *

The cairo pattern to paint.

Owner: GooCanvasImage

Flags: Read / Write

### The `“pixbuf”` property

      “pixbuf”                   GdkPixbuf *

The GdkPixbuf to display.

Owner: GooCanvasImage

Flags: Write

### The `“scale-to-fit”` property

      “scale-to-fit”             gboolean

If the image is scaled to fit the width and height settings.

Owner: GooCanvasImage

Flags: Read / Write

Default value: FALSE

### The `“width”` property

      “width”                    double

The width of the image.

Owner: GooCanvasImage

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“x”` property

      “x”                        double

The x coordinate of the image.

Owner: GooCanvasImage

Flags: Read / Write

Default value: 0

### The `“y”` property

      “y”                        double

The y coordinate of the image.

Owner: GooCanvasImage

Flags: Read / Write

Default value: 0