1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Images
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2002-11-23 23:02:10 +00:00
|
|
|
A client-side area for bit-mapped graphics
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
The #GdkImage type represents an area for drawing graphics.
|
|
|
|
It has now been superceded to a large extent by the much more flexible
|
|
|
|
<link linkend="gdk-GdkRGB">GdkRGB</link> functions.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To create an empty #GdkImage use gdk_image_new().
|
|
|
|
To create a #GdkImage from bitmap data use gdk_image_new_bitmap().
|
2001-12-29 00:24:25 +00:00
|
|
|
To create an image from part of a #GdkWindow use gdk_drawable_get_image().
|
2001-02-12 17:50:13 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The image can be manipulated with gdk_image_get_pixel() and
|
|
|
|
gdk_image_put_pixel(), or alternatively by changing the actual pixel data.
|
|
|
|
Though manipulating the pixel data requires complicated code to cope with
|
|
|
|
the different formats that may be used.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To draw a #GdkImage in a #GdkWindow or #GdkPixmap use gdk_draw_image().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To destroy a #GdkImage use gdk_image_destroy().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
<variablelist>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><link linkend="gdk-Bitmaps-and-Pixmaps">Bitmaps and Pixmaps</link></term>
|
|
|
|
<listitem><para>
|
|
|
|
Graphics which are stored on the X Windows server.
|
|
|
|
Since these are stored on the server they can be drawn very quickly, and all
|
|
|
|
of the <link linkend="gdk-Drawing-Primitives">Drawing Primitives</link> can be
|
|
|
|
used to draw on them. Their main disadvantage is that manipulating individual
|
|
|
|
pixels can be very slow.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><link linkend="gdk-GdkRGB">GdkRGB</link></term>
|
|
|
|
<listitem><para>
|
|
|
|
Built on top of #GdkImage, this provides much more functionality,
|
|
|
|
including the dithering of colors to produce better output on low-color
|
|
|
|
displays.
|
|
|
|
</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2005-06-20 22:06:27 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### STRUCT GdkImage ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
The #GdkImage struct contains information on the image and the pixel data.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2005-06-30 03:21:25 +00:00
|
|
|
@parent_instance: the parent instance
|
2001-02-12 17:50:13 +00:00
|
|
|
@type: the type of the image.
|
|
|
|
@visual: the visual.
|
|
|
|
@byte_order: the byte order.
|
|
|
|
@width: the width of the image in pixels.
|
|
|
|
@height: the height of the image in pixels.
|
|
|
|
@depth: the depth of the image, i.e. the number of bits per pixel.
|
|
|
|
@bpp: the number of bytes per pixel.
|
|
|
|
@bpl: the number of bytes per line of the image.
|
2005-06-30 03:21:25 +00:00
|
|
|
@bits_per_pixel: the number of bits per pixel.
|
2001-02-12 17:50:13 +00:00
|
|
|
@mem: the pixel data.
|
2005-06-30 03:21:25 +00:00
|
|
|
@colormap: the #GdkColormap associated with the image
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_image_new ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Creates a new #GdkImage.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@type: the type of the #GdkImage, one of %GDK_IMAGE_NORMAL, %GDK_IMAGE_SHARED
|
|
|
|
and %GDK_IMAGE_FASTEST. %GDK_IMAGE_FASTEST is probably the best choice, since
|
|
|
|
it will try creating a %GDK_IMAGE_SHARED image first and if that fails it will
|
|
|
|
then use %GDK_IMAGE_NORMAL.
|
|
|
|
@visual: the #GdkVisual to use for the image.
|
|
|
|
@width: the width of the image in pixels.
|
|
|
|
@height: the height of the image in pixels.
|
2005-08-06 05:12:11 +00:00
|
|
|
@Returns: a new #GdkImage, or %NULL if the image could not be created.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### ENUM GdkImageType ##### -->
|
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Specifies the type of a #GdkImage.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@GDK_IMAGE_NORMAL: The original X image type, which is quite slow since the
|
|
|
|
image has to be transferred from the client to the server to display it.
|
|
|
|
@GDK_IMAGE_SHARED: A faster image type, which uses shared memory to transfer
|
|
|
|
the image data between client and server. However this will only be available
|
|
|
|
if client and server are on the same machine and the shared memory extension
|
|
|
|
is supported by the server.
|
|
|
|
@GDK_IMAGE_FASTEST: Specifies that %GDK_IMAGE_SHARED should be tried first,
|
|
|
|
and if that fails then %GDK_IMAGE_NORMAL will be used.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_image_new_bitmap ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2002-10-14 23:22:58 +00:00
|
|
|
@visual:
|
|
|
|
@data:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_image_get ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
@drawable:
|
2002-04-30 18:07:51 +00:00
|
|
|
@x:
|
|
|
|
@y:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_image_ref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@image:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_image_unref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@image:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-09-07 18:17:06 +00:00
|
|
|
<!-- ##### MACRO gdk_image_destroy ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Destroys a #GdkImage, freeing any resources allocated for it.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
<!-- # Unused Parameters # -->
|
|
|
|
@image: a #GdkImage.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2001-10-03 18:19:48 +00:00
|
|
|
<!-- ##### FUNCTION gdk_image_get_colormap ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@image:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_image_set_colormap ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@image:
|
|
|
|
@colormap:
|
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_image_put_pixel ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Sets a pixel in a #GdkImage to a given pixel value.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@image: a #GdkImage.
|
|
|
|
@x: the x coordinate of the pixel to set.
|
|
|
|
@y: the y coordinate of the pixel to set.
|
|
|
|
@pixel: the pixel value to set.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-02-01 04:27:56 +00:00
|
|
|
<!-- ##### FUNCTION gdk_image_get_pixel ##### -->
|
1999-08-16 18:51:52 +00:00
|
|
|
<para>
|
2001-02-12 17:50:13 +00:00
|
|
|
Gets a pixel value at a specified position in a #GdkImage.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-02-12 17:50:13 +00:00
|
|
|
@image: a #GdkImage.
|
|
|
|
@x: the x coordinate of the pixel to get.
|
|
|
|
@y: the y coordinate of the pixel to get.
|
|
|
|
@Returns: the pixel value at the given position.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|