CrPixbuf

CrPixbuf — A item for rendering GdkPixbuf, png files, or a cairo image surface.

Synopsis

                    CrPixbuf;
CrItem*             cr_pixbuf_new                       (CrItem *parent,
                                                         double x,
                                                         double y,
                                                         const gchar *first_arg_name,
                                                         ...);

Object Hierarchy

  GObject
   +----CrItem
         +----CrPixbuf

Properties

  "anchor"                   GtkAnchorType         : Read / Write
  "height"                   gdouble               : Read
  "pattern"                  CrPattern*            : Read
  "pixbuf"                   GdkPixbuf*            : Read / Write
  "png"                      gchar*                : Write
  "scaleable"                gboolean              : Read / Write
  "surface"                  CrSurface*            : Write
  "width"                    gdouble               : Read
  "x-offset"                 gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write

Description

This canvas item is capable of rendering a GdkPixbuf, a png file, or any cairo image surface by setting either of the "pixbuf", "png", or "surface" properties.

Details

CrPixbuf

typedef struct _CrPixbuf CrPixbuf;


cr_pixbuf_new ()

CrItem*             cr_pixbuf_new                       (CrItem *parent,
                                                         double x,
                                                         double y,
                                                         const gchar *first_arg_name,
                                                         ...);

A convenience constructor for creating an pixbuf and adding it to an item group in one step.

parent :

The parent canvas item.

x :

X position of the pixbuf.

y :

Y position of the pixbuf.

first_arg_name :

... :

Returns :

A reference to a new CrItem. You must call g_object_ref if you intend to use this reference outside the local scope.

Property Details

The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

The part of the pixbuf that is referenced to the item's x, y coordinates.

Default value: GTK_ANCHOR_NORTH_WEST


The "height" property

  "height"                   gdouble               : Read

Height of the pixbuf in device units.

Default value: 0


The "pattern" property

  "pattern"                  CrPattern*            : Read

Access to the #cairo_pattern_t that is used to render this image.


The "pixbuf" property

  "pixbuf"                   GdkPixbuf*            : Read / Write

The GDK Pixbuf to draw. For images that are in other formats it may be more convenient to use the #CrPixbuf:png or #CrPixbuf:surface properties directly.


The "png" property

  "png"                      gchar*                : Write

A png file to convert to a cairo_pattern_t for drawing. This can be set as an alternative to creating a #GdkPixbuf first.

Default value: NULL


The "scaleable" property

  "scaleable"                gboolean              : Read / Write

If the pixbuf should scale and rotate to conform to item units. Setting this to FALSE will cause the image to always be the same size. See also #CrInverse for another way to achieve the same effect.

Default value: TRUE


The "surface" property

  "surface"                  CrSurface*            : Write

A #cairo_surface_t may be specified directly in lieu of using a #GdkPixbuf. The surface must be of type CAIRO_SURFACE_TYPE_IMAGE.


The "width" property

  "width"                    gdouble               : Read

Width of the pixbuf in device units.

Default value: 0


The "x-offset" property

  "x-offset"                 gdouble               : Read / Write

A device offset from the item's anchor position. Only used when scaleable=FALSE.

Default value: 0


The "y-offset" property

  "y-offset"                 gdouble               : Read / Write

A device offset from the item's anchor position. Only used when scaleable=FALSE.

Default value: 0