<br><font size=2>Below is the correct prototype of cairo_set_source_surface.
&nbsp;It does not takes 3 arguments as indicated in</font>
<br><tt><font size=3>the faq: cairo_set_source_surface (cr, dest_x - source_x,
dest_y - source_y)<br>
</font></tt>
<br>
<br><font size=4><b>cairo_set_source_surface ()</b></font>
<br><tt><font size=3>void &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;cairo_set_source_surface &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(</font></tt><a href="http://www.cairographics.org/manual/cairo-context.html#cairo-t"><tt><font size=3 color=blue>cairo_t</font></tt></a><tt><font size=3>
*cr,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font></tt><a href="http://www.cairographics.org/manual/cairo-surface.html#cairo-surface-t"><tt><font size=3 color=blue>cairo_surface_t</font></tt></a><tt><font size=3>
*surface,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double x,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double y);</font></tt>
<p><font size=3>This is a convenience function for creating a pattern from
</font><tt><font size=3><i>surface</i></font></tt><font size=3> and setting
it as the source in </font><tt><font size=3><i>cr</i></font></tt><font size=3>
with </font><a href="http://www.cairographics.org/manual/cairo-context.html#cairo-set-source"><tt><font size=3 color=blue>cairo_set_source()</font></tt></a><font size=3>.
</font>
<p><font size=3>The </font><tt><font size=3><i>x</i></font></tt><font size=3>
and </font><tt><font size=3><i>y</i></font></tt><font size=3> parameters
give the user-space coordinate at which the surface origin should appear.
(The surface origin is its upper-left corner before any transformation
has been applied.) The </font><tt><font size=3><i>x</i></font></tt><font size=3>
and </font><tt><font size=3><i>y</i></font></tt><font size=3> patterns
are negated and then set as translation values in the pattern matrix. </font>
<p><font size=3>Other than the initial translation pattern matrix, as described
above, all other pattern attributes, (such as its extend mode), are set
to the default values as in </font><a href="http://www.cairographics.org/manual/cairo-pattern.html#cairo-pattern-create-for-surface"><tt><font size=3 color=blue>cairo_pattern_create_for_surface()</font></tt></a><font size=3>.
The resulting pattern can be queried with </font><a href="http://www.cairographics.org/manual/cairo-context.html#cairo-get-source"><tt><font size=3 color=blue>cairo_get_source()</font></tt></a><font size=3>
so that these attributes can be modified if desired, (eg. to create a repeating
pattern with </font><a href="http://www.cairographics.org/manual/cairo-pattern.html#cairo-pattern-set-extend"><tt><font size=3 color=blue>cairo_pattern_set_extend()</font></tt></a><font size=3>).</font>
<p>
<table>
<tr>
<td valign=top><tt><font size=3><i>cr</i></font></tt><font size=3>&nbsp;:</font>
<td><font size=3>a cairo context </font>
<tr>
<td valign=top><tt><font size=3><i>surface</i></font></tt><font size=3>&nbsp;:</font>
<td><font size=3>a surface to be used to set the source pattern </font>
<tr>
<td valign=top><tt><font size=3><i>x</i></font></tt><font size=3>&nbsp;:</font>
<td><font size=3>User-space X coordinate for surface origin </font>
<tr>
<td valign=top><tt><font size=3><i>y</i></font></tt><font size=3>&nbsp;:</font>
<td><font size=3>User-space Y coordinate for surface origin </font></table>
<br>
<br><font size=2 face="sans-serif">See</font>
<br><a href="http://www.cairographics.org/manual/cairo-context.html#cairo-set-source-surface"><font size=2 face="sans-serif">http://www.cairographics.org/manual/cairo-context.html#cairo-set-source-surface</font></a>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Kelvin</font>