MxImage

MxImage — A widget to display an image

Synopsis

enum                MxImageError;
struct              MxImage;
struct              MxImageClass;
ClutterActor *      mx_image_new                        (void);
gboolean            mx_image_set_from_data              (MxImage *image,
                                                         const guchar *data,
                                                         CoglPixelFormat pixel_format,
                                                         gint width,
                                                         gint height,
                                                         gint rowstride,
                                                         GError **error);
gboolean            mx_image_set_from_file              (MxImage *image,
                                                         const gchar *filename,
                                                         GError **error);
void                mx_image_set_scale_mode             (MxImage *image,
                                                         MxImageScaleMode mode);
MxImageScaleMode    mx_image_get_scale_mode             (MxImage *image);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----MxWidget
                     +----MxImage

Implemented Interfaces

MxImage implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and MxStylable.

Properties

  "scale-mode"               MxImageScaleMode      : Read / Write

Description

The MxImage widget can load and display images. The image may be centered or scaled to fit within the allocation. A transition effect occurs when a new image is loaded.

Details

enum MxImageError

typedef enum
{
  MX_IMAGE_ERROR_BAD_FORMAT
} MxImageError;


struct MxImage

struct MxImage;

The contents of this structure are private and should only be accessed through the public API.


struct MxImageClass

struct MxImageClass {
};


mx_image_new ()

ClutterActor *      mx_image_new                        (void);

Creates a new MxImage object.

Returns :

A newly created MxImage object

mx_image_set_from_data ()

gboolean            mx_image_set_from_data              (MxImage *image,
                                                         const guchar *data,
                                                         CoglPixelFormat pixel_format,
                                                         gint width,
                                                         gint height,
                                                         gint rowstride,
                                                         GError **error);

Set the image data from a buffer. In case of failure, FALSE is returned and error is set.

image :

An MxImage

data :

Image data

pixel_format :

The CoglPixelFormat of the buffer

width :

Width in pixels of image data.

height :

Height in pixels of image data

rowstride :

Distance in bytes between row starts.

error :

Return location for a GError, or NULL

Returns :

TRUE if the image was successfully updated

mx_image_set_from_file ()

gboolean            mx_image_set_from_file              (MxImage *image,
                                                         const gchar *filename,
                                                         GError **error);

Set the image data from an image file. In case of failure, FALSE is returned and error is set.

image :

An MxImage

filename :

Filename to read the file from

error :

Return location for a GError, or NULL

Returns :

TRUE if the image was successfully updated

mx_image_set_scale_mode ()

void                mx_image_set_scale_mode             (MxImage *image,
                                                         MxImageScaleMode mode);

Set the scale mode on MxImage

image :

An MxImage

mode :

The MxImageScaleMode to set

mx_image_get_scale_mode ()

MxImageScaleMode    mx_image_get_scale_mode             (MxImage *image);

Get the current scale mode of MxImage.

image :

An MxImage

Returns :

The current MxImageScaleMode

Property Details

The "scale-mode" property

  "scale-mode"               MxImageScaleMode      : Read / Write

The scaling mode for the images.

Default value: MX_IMAGE_SCALE_NONE