Synopsis#include <gdk/gdk.h> GdkImage; GdkImage* gdk_image_new (GdkImageType type, GdkVisual *visual, gint width, gint height); enum GdkImageType; GdkImage* gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint width, gint height); GdkImage* gdk_image_get (GdkDrawable *drawable, gint x, gint y, gint width, gint height); GdkImage* gdk_image_ref (GdkImage *image); void gdk_image_unref (GdkImage *image); #define gdk_image_destroy GdkColormap* gdk_image_get_colormap (GdkImage *image); void gdk_image_set_colormap (GdkImage *image, GdkColormap *colormap); void gdk_image_put_pixel (GdkImage *image, gint x, gint y, guint32 pixel); guint32 gdk_image_get_pixel (GdkImage *image, gint x, gint y); DescriptionThe GdkImage type represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible GdkRGB functions.
To create an empty GdkImage use
The image can be manipulated with
To draw a GdkImage in a GdkWindow or GdkPixmap use
To destroy a GdkImage use DetailsGdkImagetypedef struct { GObject parent_instance; GdkImageType type; /* read only. */ GdkVisual *visual; /* read only. visual used to create the image */ GdkByteOrder byte_order; /* read only. */ gint width; /* read only. */ gint height; /* read only. */ guint16 depth; /* read only. */ guint16 bpp; /* read only. bytes per pixel */ guint16 bpl; /* read only. bytes per line */ guint16 bits_per_pixel; /* read only. bits per pixel */ gpointer mem; GdkColormap *colormap; /* read only. */ } GdkImage; The GdkImage struct contains information on the image and the pixel data.
gdk_image_new ()GdkImage* gdk_image_new (GdkImageType type, GdkVisual *visual, gint width, gint height); Creates a new GdkImage.
enum GdkImageTypetypedef enum { GDK_IMAGE_NORMAL, GDK_IMAGE_SHARED, GDK_IMAGE_FASTEST } GdkImageType; Specifies the type of a GdkImage.
gdk_image_new_bitmap ()GdkImage* gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint width, gint height); Warning
Creates a new GdkImage with a depth of 1 from the given data. WarningTHIS FUNCTION IS INCREDIBLY BROKEN. The passed-in data must
be allocated by
gdk_image_get ()GdkImage* gdk_image_get (GdkDrawable *drawable, gint x, gint y, gint width, gint height); Warning
This is a deprecated wrapper for
gdk_image_ref ()GdkImage* gdk_image_ref (GdkImage *image); Warning
Deprecated function; use
gdk_image_unref ()void gdk_image_unref (GdkImage *image); Warning
Deprecated function; use
gdk_image_destroy#define gdk_image_destroy gdk_image_unref Warning
Destroys a GdkImage, freeing any resources allocated for it. gdk_image_get_colormap ()GdkColormap* gdk_image_get_colormap (GdkImage *image);
Retrieves the colormap for a given image, if it exists. An image
will have a colormap if the drawable from which it was created has
a colormap, or if a colormap was set explicitely with
gdk_image_set_colormap ()void gdk_image_set_colormap (GdkImage *image, GdkColormap *colormap); Sets the colormap for the image to the given colormap. Normally there's no need to use this function, images are created with the correct colormap if you get the image from a drawable. If you create the image from scratch, use the colormap of the drawable you intend to render the image to.
gdk_image_put_pixel ()void gdk_image_put_pixel (GdkImage *image, gint x, gint y, guint32 pixel); Sets a pixel in a GdkImage to a given pixel value.
See Also
|