1999-11-04 07:30:04 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
1999-11-04 21:52:08 +00:00
|
|
|
Image Data in Memory
|
1999-11-04 07:30:04 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
1999-11-04 08:14:32 +00:00
|
|
|
Creating a pixbuf from image data that is already in memory.
|
1999-11-04 07:30:04 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
1999-11-04 08:14:32 +00:00
|
|
|
<para>
|
1999-11-04 21:52:08 +00:00
|
|
|
The most basic way to create a pixbuf is to wrap an existing
|
|
|
|
#ArtPixBuf structure with a #GdkPixbuf to add reference counting
|
|
|
|
capabilities to it. The gdk_pixbuf_new_from_art_pixbuf() performs
|
|
|
|
this operation.
|
|
|
|
</para>
|
1999-11-04 07:30:04 +00:00
|
|
|
|
1999-11-04 21:52:08 +00:00
|
|
|
<para>
|
|
|
|
As a convenience, you can use the gdk_pixbuf_new_from_data()
|
|
|
|
function to wrap an existing data buffer with a #GdkPixbuf. You
|
|
|
|
need to specify the destroy notification function that will be
|
|
|
|
called when the data buffer needs to be freed; this will happen
|
|
|
|
when the pixbuf's reference count drops to zero and thus the
|
|
|
|
#ArtPixBuf needs to be destroyed. If you have a chunk of static
|
|
|
|
data compiled into your application, you can pass in #NULL as the
|
|
|
|
destroy notification function so that the data will not be freed.
|
1999-11-04 08:14:32 +00:00
|
|
|
</para>
|
1999-11-04 07:30:04 +00:00
|
|
|
|
1999-11-04 21:52:08 +00:00
|
|
|
<para>
|
|
|
|
The gdk_pixbuf_new() function can be used as a convenience to
|
|
|
|
create a pixbuf with an empty buffer. This is equivalent to
|
|
|
|
allocating a data buffer using malloc() and then wrapping it with
|
|
|
|
gdk_pixbuf_new_from_data(). The gdk_pixbuf_new() function will
|
|
|
|
compute an optimal rowstride so that rendering can be performed
|
|
|
|
with an efficient algorithm.
|
|
|
|
</para>
|
1999-11-04 07:30:04 +00:00
|
|
|
|
1999-11-04 21:52:08 +00:00
|
|
|
<para>
|
|
|
|
As a special case, you can use the gdk_pixbuf_new_from_xpm_data()
|
|
|
|
function to create a pixbuf from inline XPM image data.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
#ArtPixBuf
|
|
|
|
</para>
|
1999-11-04 07:30:04 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_pixbuf_new_from_art_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@art_pixbuf:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_pixbuf_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@format:
|
|
|
|
@has_alpha:
|
|
|
|
@bits_per_sample:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_pixbuf_new_from_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@data:
|
|
|
|
@format:
|
|
|
|
@has_alpha:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@rowstride:
|
|
|
|
@dfunc:
|
|
|
|
@dfunc_data:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_pixbuf_new_from_xpm_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@data:
|
1999-11-10 22:48:46 +00:00
|
|
|
@Returns: <!--
|
1999-11-04 08:14:32 +00:00
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
|
|
|
|
End:
|
|
|
|
-->
|
1999-11-04 21:52:08 +00:00
|
|
|
|
|
|
|
|