| Mx Toolkit Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | ||||
enum MxImageError; MxImage; 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);
MxImage implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and MxStylable.
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.
typedef struct _MxImage MxImage;
The contents of this structure are private and should only be accessed through the public API.
ClutterActor * mx_image_new (void);
Creates a new MxImage object.
Returns : |
A newly created MxImage object |
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.
|
An MxImage |
|
Image data |
|
The CoglPixelFormat of the buffer |
|
Width in pixels of image data. |
|
Height in pixels of image data |
|
Distance in bytes between row starts. |
|
Return location for a GError, or NULL |
Returns : |
TRUE if the image was successfully updated |
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.
void mx_image_set_scale_mode (MxImage *image,MxImageScaleMode mode);
Set the scale mode on MxImage
|
An MxImage |
|
The MxImageScaleMode to set |
MxImageScaleMode mx_image_get_scale_mode (MxImage *image);
Get the current scale mode of MxImage.
|
An MxImage |
Returns : |
The current MxImageScaleMode |
"scale-mode" property"scale-mode" MxImageScaleMode : Read / Write
The scaling mode for the images.
Default value: MX_IMAGE_SCALE_NONE