~bratsche/ubuntu/maverick/gtk+2.0/menu-activation-fix

« back to all changes in this revision

Viewing changes to docs/reference/gdk-pixbuf/html/gdk-pixbuf-file-loading.html

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-07-22 21:41:30 UTC
  • mfrom: (1.11.7 upstream) (72.1.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20100722214130-5uzyvpb9g4m0ts2c
Tags: 2.21.5-1ubuntu1
* Merge with Debian experimental, Ubuntu changes:
* debian/control.in:
  - Add introspection build-depends
  - Add Vcs-Bzr link
  - Add gir1.0-gtk-2.0 package
  - libgtk2.0-dev replaces gir-repository-dev
  - Conflict with appmenu-gtk (<< 0.1.3) to prevent menu proxy breakage
* debian/rules:
  - Build with --enable-introspection
  - Add gir1.0-gtk-2.0 package to BINARY_ARCH_PKGS
  - Add dh_girepository call
  - Disable devhelp files
* debian/dh_gtkmodules.in:
  - Remove obsolete script content
* debian/libgtk2.0-0.symbols:
  - Add Ubuntu specific symbols
* debian/libgtk2.0-dev.install.in:
  - Add gir files
* debian/libgtk2.0-doc.install.in
  - Disable devhelp files
* debian/gir1.0-gtk-2.0.install.in
  - Introspection package
* debian/patches/043_menu_proxy.patch
  - Add GtkMenuProxy support for remoting menus.
* debian/patches/062_dnd_menubar.patch:
  - Allow click on menubars for dnd
* debian/patches/063_treeview_almost_fixed.patch:
  - Add an ubuntu-almost-fixed-height-mode property, (required for
    software-center)
* debian/patches/071_no_offscreen_widgets_grabbing.patch:
  - Don't let offscreen widgets do grabbing
* debian/patches/072_indicator_menu_update.patch:
  - change by Cody Russell to send an update event on menu changes,
    should make the bluetooth indicator refresh correctly
* debian/patches/091_bugzilla_tooltip_refresh.patch:
  - Upstream bugzilla change to have better looking tooltips the gtk theme
    need to set "new-tooltip-style" to use those
* debian/watch:
  - Watch for unstable versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
 
<title>File Loading</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
 
<link rel="home" href="index.html" title="GDK-PixBuf Reference Manual">
8
 
<link rel="up" href="rn01.html" title="API Reference">
9
 
<link rel="prev" href="gdk-pixbuf-refcounting.html" title="Reference Counting and Memory Mangement">
10
 
<link rel="next" href="gdk-pixbuf-file-saving.html" title="File saving">
11
 
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
12
 
<link rel="stylesheet" href="style.css" type="text/css">
13
 
</head>
14
 
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
 
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16
 
<tr valign="middle">
17
 
<td><a accesskey="p" href="gdk-pixbuf-refcounting.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
 
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
 
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
 
<th width="100%" align="center">GDK-PixBuf Reference Manual</th>
21
 
<td><a accesskey="n" href="gdk-pixbuf-file-saving.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22
 
</tr>
23
 
<tr><td colspan="5" class="shortcuts">
24
 
<a href="#gdk-pixbuf-file-loading.synopsis" class="shortcut">Top</a>
25
 
                   | 
26
 
                  <a href="#gdk-pixbuf-file-loading.description" class="shortcut">Description</a>
27
 
</td></tr>
28
 
</table>
29
 
<div class="refentry" title="File Loading">
30
 
<a name="gdk-pixbuf-file-loading"></a><div class="titlepage"></div>
31
 
<div class="refnamediv"><table width="100%"><tr>
32
 
<td valign="top">
33
 
<h2><span class="refentrytitle"><a name="gdk-pixbuf-file-loading.top_of_page"></a>File Loading</span></h2>
34
 
<p>File Loading — Loading a pixbuf from a file.</p>
35
 
</td>
36
 
<td valign="top" align="right"></td>
37
 
</tr></table></div>
38
 
<div class="refsynopsisdiv" title="Synopsis">
39
 
<a name="gdk-pixbuf-file-loading.synopsis"></a><h2>Synopsis</h2>
40
 
<pre class="synopsis">
41
 
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;
42
 
 
43
 
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file" title="gdk_pixbuf_new_from_file ()">gdk_pixbuf_new_from_file</a>            (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
44
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
45
 
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file-at-size" title="gdk_pixbuf_new_from_file_at_size ()">gdk_pixbuf_new_from_file_at_size</a>    (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
46
 
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
47
 
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>,
48
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
49
 
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file-at-scale" title="gdk_pixbuf_new_from_file_at_scale ()">gdk_pixbuf_new_from_file_at_scale</a>   (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
50
 
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
51
 
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>,
52
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> preserve_aspect_ratio</code></em>,
53
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
54
 
<a class="link" href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat" title="GdkPixbufFormat"><span class="returnvalue">GdkPixbufFormat</span></a> *   <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-get-file-info" title="gdk_pixbuf_get_file_info ()">gdk_pixbuf_get_file_info</a>            (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
55
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>,
56
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *height</code></em>);
57
 
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-stream" title="gdk_pixbuf_new_from_stream ()">gdk_pixbuf_new_from_stream</a>          (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> *stream</code></em>,
58
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
59
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
60
 
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-stream-at-scale" title="gdk_pixbuf_new_from_stream_at_scale ()">gdk_pixbuf_new_from_stream_at_scale</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> *stream</code></em>,
61
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
62
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>,
63
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> preserve_aspect_ratio</code></em>,
64
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
65
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
66
 
</pre>
67
 
</div>
68
 
<div class="refsect1" title="Description">
69
 
<a name="gdk-pixbuf-file-loading.description"></a><h2>Description</h2>
70
 
<p>
71
 
    The <span class="application">gdk-pixbuf</span> library provides a simple mechanism for loading
72
 
    an image from a file in synchronous fashion.  This means that the
73
 
    library takes control of the application while the file is being
74
 
    loaded; from the user's point of view, the application will block
75
 
    until the image is done loading.
76
 
  </p>
77
 
<p>
78
 
    This interface can be used by applications in which blocking is
79
 
    acceptable while an image is being loaded.  It can also be used to
80
 
    load small images in general.  Applications that need progressive
81
 
    loading can use the <a class="link" href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a> functionality instead.
82
 
  </p>
83
 
</div>
84
 
<div class="refsect1" title="Details">
85
 
<a name="gdk-pixbuf-file-loading.details"></a><h2>Details</h2>
86
 
<div class="refsect2" title="gdk_pixbuf_new_from_file ()">
87
 
<a name="gdk-pixbuf-new-from-file"></a><h3>gdk_pixbuf_new_from_file ()</h3>
88
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_new_from_file            (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
89
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
90
 
<p>
91
 
Creates a new pixbuf by loading an image from a file.  The file format is
92
 
detected automatically. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then <em class="parameter"><code>error</code></em> will be set.
93
 
Possible errors are in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> domains.
94
 
</p>
95
 
<div class="variablelist"><table border="0">
96
 
<col align="left" valign="top">
97
 
<tbody>
98
 
<tr>
99
 
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
100
 
<td>Name of file to load, in the GLib file name encoding
101
 
</td>
102
 
</tr>
103
 
<tr>
104
 
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
105
 
<td>Return location for an error
106
 
</td>
107
 
</tr>
108
 
<tr>
109
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
110
 
<td> A newly-created pixbuf with a reference count of 1, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if
111
 
any of several error conditions occurred:  the file could not be opened,
112
 
there was no loader for the file's format, there was not enough memory to
113
 
allocate the image buffer, or the image file contained invalid data.
114
 
</td>
115
 
</tr>
116
 
</tbody>
117
 
</table></div>
118
 
</div>
119
 
<hr>
120
 
<div class="refsect2" title="gdk_pixbuf_new_from_file_at_size ()">
121
 
<a name="gdk-pixbuf-new-from-file-at-size"></a><h3>gdk_pixbuf_new_from_file_at_size ()</h3>
122
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_new_from_file_at_size    (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
123
 
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
124
 
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>,
125
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
126
 
<p>
127
 
Creates a new pixbuf by loading an image from a file.  
128
 
The file format is detected automatically. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then 
129
 
<em class="parameter"><code>error</code></em> will be set. Possible errors are in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and 
130
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> domains.
131
 
</p>
132
 
<p>
133
 
The image will be scaled to fit in the requested size, preserving
134
 
the image's aspect ratio. Note that the returned pixbuf may be smaller
135
 
than <em class="parameter"><code>width</code></em> x <em class="parameter"><code>height</code></em>, if the aspect ratio requires it. To load
136
 
and image at the requested size, regardless of aspect ratio, use
137
 
<a class="link" href="gdk-pixbuf-file-loading.html#gdk-pixbuf-new-from-file-at-scale" title="gdk_pixbuf_new_from_file_at_scale ()"><code class="function">gdk_pixbuf_new_from_file_at_scale()</code></a>.
138
 
</p>
139
 
<div class="variablelist"><table border="0">
140
 
<col align="left" valign="top">
141
 
<tbody>
142
 
<tr>
143
 
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
144
 
<td>Name of file to load, in the GLib file name encoding
145
 
</td>
146
 
</tr>
147
 
<tr>
148
 
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
149
 
<td>The width the image should have or -1 to not constrain the width
150
 
</td>
151
 
</tr>
152
 
<tr>
153
 
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
154
 
<td>The height the image should have or -1 to not constrain the height
155
 
</td>
156
 
</tr>
157
 
<tr>
158
 
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
159
 
<td>Return location for an error
160
 
</td>
161
 
</tr>
162
 
<tr>
163
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
164
 
<td> A newly-created pixbuf with a reference count of 1, or 
165
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if any of several error conditions occurred:  the file could not 
166
 
be opened, there was no loader for the file's format, there was not 
167
 
enough memory to allocate the image buffer, or the image file contained 
168
 
invalid data.
169
 
 
170
 
</td>
171
 
</tr>
172
 
</tbody>
173
 
</table></div>
174
 
<p class="since">Since 2.4</p>
175
 
</div>
176
 
<hr>
177
 
<div class="refsect2" title="gdk_pixbuf_new_from_file_at_scale ()">
178
 
<a name="gdk-pixbuf-new-from-file-at-scale"></a><h3>gdk_pixbuf_new_from_file_at_scale ()</h3>
179
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_new_from_file_at_scale   (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
180
 
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
181
 
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>,
182
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> preserve_aspect_ratio</code></em>,
183
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
184
 
<p>
185
 
Creates a new pixbuf by loading an image from a file.  The file format is
186
 
detected automatically. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then <em class="parameter"><code>error</code></em> will be set.
187
 
Possible errors are in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> domains.
188
 
The image will be scaled to fit in the requested size, optionally preserving
189
 
the image's aspect ratio. 
190
 
</p>
191
 
<p>
192
 
When preserving the aspect ratio, a <em class="parameter"><code>width</code></em> of -1 will cause the image
193
 
to be scaled to the exact given height, and a <em class="parameter"><code>height</code></em> of -1 will cause
194
 
the image to be scaled to the exact given width. When not preserving
195
 
aspect ratio, a <em class="parameter"><code>width</code></em> or <em class="parameter"><code>height</code></em> of -1 means to not scale the image 
196
 
at all in that dimension. Negative values for <em class="parameter"><code>width</code></em> and <em class="parameter"><code>height</code></em> are 
197
 
allowed since 2.8.
198
 
</p>
199
 
<div class="variablelist"><table border="0">
200
 
<col align="left" valign="top">
201
 
<tbody>
202
 
<tr>
203
 
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
204
 
<td>Name of file to load, in the GLib file name encoding
205
 
</td>
206
 
</tr>
207
 
<tr>
208
 
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
209
 
<td>The width the image should have or -1 to not constrain the width
210
 
</td>
211
 
</tr>
212
 
<tr>
213
 
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
214
 
<td>The height the image should have or -1 to not constrain the height
215
 
</td>
216
 
</tr>
217
 
<tr>
218
 
<td><p><span class="term"><em class="parameter"><code>preserve_aspect_ratio</code></em> :</span></p></td>
219
 
<td>
220
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to preserve the image's aspect ratio
221
 
</td>
222
 
</tr>
223
 
<tr>
224
 
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
225
 
<td>Return location for an error
226
 
</td>
227
 
</tr>
228
 
<tr>
229
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
230
 
<td> A newly-created pixbuf with a reference count of 1, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> 
231
 
if any of several error conditions occurred:  the file could not be opened,
232
 
there was no loader for the file's format, there was not enough memory to
233
 
allocate the image buffer, or the image file contained invalid data.
234
 
 
235
 
</td>
236
 
</tr>
237
 
</tbody>
238
 
</table></div>
239
 
<p class="since">Since 2.6</p>
240
 
</div>
241
 
<hr>
242
 
<div class="refsect2" title="gdk_pixbuf_get_file_info ()">
243
 
<a name="gdk-pixbuf-get-file-info"></a><h3>gdk_pixbuf_get_file_info ()</h3>
244
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat" title="GdkPixbufFormat"><span class="returnvalue">GdkPixbufFormat</span></a> *   gdk_pixbuf_get_file_info            (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
245
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *width</code></em>,
246
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *height</code></em>);</pre>
247
 
<p>
248
 
Parses an image file far enough to determine its format and size.
249
 
</p>
250
 
<div class="variablelist"><table border="0">
251
 
<col align="left" valign="top">
252
 
<tbody>
253
 
<tr>
254
 
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
255
 
<td>The name of the file to identify.
256
 
</td>
257
 
</tr>
258
 
<tr>
259
 
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
260
 
<td>Return location for the width of the image, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
261
 
</td>
262
 
</tr>
263
 
<tr>
264
 
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
265
 
<td>Return location for the height of the image, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
266
 
</td>
267
 
</tr>
268
 
<tr>
269
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
270
 
<td> A <a class="link" href="gdk-pixbuf-Module-Interface.html#GdkPixbufFormat" title="GdkPixbufFormat"><span class="type">GdkPixbufFormat</span></a> describing the image format of the file 
271
 
   or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the image format wasn't recognized. The return value 
272
 
   is owned by GdkPixbuf and should not be freed.
273
 
 
274
 
</td>
275
 
</tr>
276
 
</tbody>
277
 
</table></div>
278
 
<p class="since">Since 2.4</p>
279
 
</div>
280
 
<hr>
281
 
<div class="refsect2" title="gdk_pixbuf_new_from_stream ()">
282
 
<a name="gdk-pixbuf-new-from-stream"></a><h3>gdk_pixbuf_new_from_stream ()</h3>
283
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_new_from_stream          (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> *stream</code></em>,
284
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
285
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
286
 
<p>
287
 
Creates a new pixbuf by loading an image from an input stream.  
288
 
</p>
289
 
<p>
290
 
The file format is detected automatically. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then 
291
 
<em class="parameter"><code>error</code></em> will be set. The <em class="parameter"><code>cancellable</code></em> can be used to abort the operation
292
 
from another thread. If the operation was cancelled, the error 
293
 
<code class="literal">GIO_ERROR_CANCELLED</code> will be returned. Other possible errors are in 
294
 
the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR:CAPS"><code class="literal">G_IO_ERROR</code></a> domains. 
295
 
</p>
296
 
<p>
297
 
The stream is not closed.
298
 
</p>
299
 
<div class="variablelist"><table border="0">
300
 
<col align="left" valign="top">
301
 
<tbody>
302
 
<tr>
303
 
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
304
 
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> to load the pixbuf from
305
 
</td>
306
 
</tr>
307
 
<tr>
308
 
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
309
 
<td>optional <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> object, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore
310
 
</td>
311
 
</tr>
312
 
<tr>
313
 
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
314
 
<td>Return location for an error
315
 
</td>
316
 
</tr>
317
 
<tr>
318
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
319
 
<td> A newly-created pixbuf, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if any of several error 
320
 
conditions occurred: the file could not be opened, the image format is 
321
 
not supported, there was not enough memory to allocate the image buffer, 
322
 
the stream contained invalid data, or the operation was cancelled.
323
 
 
324
 
</td>
325
 
</tr>
326
 
</tbody>
327
 
</table></div>
328
 
<p class="since">Since 2.14</p>
329
 
</div>
330
 
<hr>
331
 
<div class="refsect2" title="gdk_pixbuf_new_from_stream_at_scale ()">
332
 
<a name="gdk-pixbuf-new-from-stream-at-scale"></a><h3>gdk_pixbuf_new_from_stream_at_scale ()</h3>
333
 
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_new_from_stream_at_scale (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> *stream</code></em>,
334
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> width</code></em>,
335
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> height</code></em>,
336
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> preserve_aspect_ratio</code></em>,
337
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
338
 
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
339
 
<p>
340
 
Creates a new pixbuf by loading an image from an input stream.  
341
 
</p>
342
 
<p>
343
 
The file format is detected automatically. If <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned, then 
344
 
<em class="parameter"><code>error</code></em> will be set. The <em class="parameter"><code>cancellable</code></em> can be used to abort the operation
345
 
from another thread. If the operation was cancelled, the error 
346
 
<code class="literal">GIO_ERROR_CANCELLED</code> will be returned. Other possible errors are in 
347
 
the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR:CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> and <a href="http://library.gnome.org/devel/gio/unstable/gio-GIOError.html#G-IO-ERROR:CAPS"><code class="literal">G_IO_ERROR</code></a> domains. 
348
 
</p>
349
 
<p>
350
 
The image will be scaled to fit in the requested size, optionally 
351
 
preserving the image's aspect ratio. When preserving the aspect ratio, 
352
 
a <em class="parameter"><code>width</code></em> of -1 will cause the image to be scaled to the exact given 
353
 
height, and a <em class="parameter"><code>height</code></em> of -1 will cause the image to be scaled to the 
354
 
exact given width. When not preserving aspect ratio, a <em class="parameter"><code>width</code></em> or 
355
 
<em class="parameter"><code>height</code></em> of -1 means to not scale the image at all in that dimension.
356
 
</p>
357
 
<p>
358
 
The stream is not closed.
359
 
</p>
360
 
<div class="variablelist"><table border="0">
361
 
<col align="left" valign="top">
362
 
<tbody>
363
 
<tr>
364
 
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
365
 
<td>a <a href="http://library.gnome.org/devel/gio/unstable/GInputStream.html"><span class="type">GInputStream</span></a> to load the pixbuf from
366
 
</td>
367
 
</tr>
368
 
<tr>
369
 
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
370
 
<td>The width the image should have or -1 to not constrain the width
371
 
</td>
372
 
</tr>
373
 
<tr>
374
 
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
375
 
<td>The height the image should have or -1 to not constrain the height
376
 
</td>
377
 
</tr>
378
 
<tr>
379
 
<td><p><span class="term"><em class="parameter"><code>preserve_aspect_ratio</code></em> :</span></p></td>
380
 
<td>
381
 
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to preserve the image's aspect ratio
382
 
</td>
383
 
</tr>
384
 
<tr>
385
 
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
386
 
<td>optional <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> object, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore
387
 
</td>
388
 
</tr>
389
 
<tr>
390
 
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
391
 
<td>Return location for an error
392
 
</td>
393
 
</tr>
394
 
<tr>
395
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
396
 
<td> A newly-created pixbuf, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if any of several error 
397
 
conditions occurred: the file could not be opened, the image format is 
398
 
not supported, there was not enough memory to allocate the image buffer, 
399
 
the stream contained invalid data, or the operation was cancelled.
400
 
 
401
 
</td>
402
 
</tr>
403
 
</tbody>
404
 
</table></div>
405
 
<p class="since">Since 2.14</p>
406
 
</div>
407
 
</div>
408
 
<div class="refsect1" title="See Also">
409
 
<a name="gdk-pixbuf-file-loading.see-also"></a><h2>See Also</h2>
410
 
<p>
411
 
    <a class="link" href="GdkPixbufLoader.html" title="GdkPixbufLoader"><span class="type">GdkPixbufLoader</span></a>.
412
 
  </p>
413
 
</div>
414
 
</div>
415
 
<div class="footer">
416
 
<hr>
417
 
          Generated by GTK-Doc V1.15</div>
418
 
</body>
419
 
</html>
 
 
b'\\ No newline at end of file'