<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk4-Pixbufs">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-Pixbufs.top_of_page">GdkPixbuf Interaction</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GdkPixbuf Interaction</refname>
<refpurpose>Functions for obtaining pixbufs</refpurpose>
</refnamediv>

<refsect1 id="gdk4-Pixbufs.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-pixbuf-get-from-surface">gdk_pixbuf_get_from_surface</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-pixbuf-get-from-texture">gdk_pixbuf_get_from_texture</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="gdk4-Pixbufs.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="gdk4-Pixbufs.description" role="desc">
<title role="desc.title">Description</title>
<para>Pixbufs are client-side images. For details on how to create
and manipulate pixbufs, see the <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> API documentation.</para>
<para>The functions described here allow to obtain pixbufs from
<link linkend="GdkSurfaces"><type>GdkSurfaces</type></link> and cairo surfaces.</para>

</refsect1>
<refsect1 id="gdk4-Pixbufs.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-pixbuf-get-from-surface" role="function">
<title>gdk_pixbuf_get_from_surface&#160;()</title>
<indexterm zone="gdk-pixbuf-get-from-surface"><primary>gdk_pixbuf_get_from_surface</primary></indexterm>
<programlisting language="C"><link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link>&#160;*
gdk_pixbuf_get_from_surface (<parameter><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> *surface</parameter>,
                             <parameter><link linkend="int"><type>int</type></link> src_x</parameter>,
                             <parameter><link linkend="int"><type>int</type></link> src_y</parameter>,
                             <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                             <parameter><link linkend="int"><type>int</type></link> height</parameter>);</programlisting>
<para>Transfers image data from a <link linkend="cairo-surface-t"><type>cairo_surface_t</type></link> and converts it to an RGB(A)
representation inside a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>. This allows you to efficiently read
individual pixels from cairo surfaces.</para>
<para>This function will create an RGB pixbuf with 8 bits per channel.
The pixbuf will contain an alpha channel if the <parameter>surface</parameter>
 contains one.</para>
<refsect3 id="gdk-pixbuf-get-from-surface.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>surface</para></entry>
<entry role="parameter_description"><para>surface to copy from</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>src_x</para></entry>
<entry role="parameter_description"><para>Source X coordinate within <parameter>surface</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>src_y</para></entry>
<entry role="parameter_description"><para>Source Y coordinate within <parameter>surface</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>Width in pixels of region to get</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>Height in pixels of region to get</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-pixbuf-get-from-surface.returns" role="returns">
<title>Returns</title>
<para>A newly-created pixbuf with a
reference count of 1, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-pixbuf-get-from-texture" role="function">
<title>gdk_pixbuf_get_from_texture&#160;()</title>
<indexterm zone="gdk-pixbuf-get-from-texture"><primary>gdk_pixbuf_get_from_texture</primary></indexterm>
<programlisting language="C"><link linkend="GdkPixbuf"><returnvalue>GdkPixbuf</returnvalue></link>&#160;*
gdk_pixbuf_get_from_texture (<parameter><link linkend="GdkTexture"><type>GdkTexture</type></link> *texture</parameter>);</programlisting>
<para>Creates a new pixbuf from <parameter>texture</parameter>
. This should generally not be used
in newly written code as later stages will almost certainly convert
the pixbuf back into a texture to draw it on screen.</para>
<refsect3 id="gdk-pixbuf-get-from-texture.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>texture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkTexture"><type>GdkTexture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-pixbuf-get-from-texture.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
in case of an error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>

</refsect1>

</refentry>
