<p>You can use ..._clip() or ..._rectangle() with ..._fill()</p>
<p>Gr. Arjen</p>
<div class="gmail_quote">On Mar 16, 2012 6:13 AM, "Christopher Howard" <<a href="mailto:christopher.howard@frigidcode.com">christopher.howard@frigidcode.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi. I've got this noobie question. I posted it at the gtk list, but<br>
didn't get a response, so I'm going straight to the source:<br>
<br>
I'm coding a simple space combat game with GTK+/cairo. For the sprites,<br>
I know I can do this:<br>
<br>
code:<br>
----------<br>
ship_surf = cairo_image_surface_create_from_png("ship.png");<br>
// ...<br>
cairo_set_source_surface (cr, ship_surf, x, y);<br>
cairo_paint (cr);<br>
----------<br>
<br>
But what if I want, for ease of maintainability (and less system I/O<br>
calls) to put a whole bunch of sprites in one PNG? Is it possible for me<br>
to either...<br>
<br>
* load one PNG image into a surface, and then draw to a CR using only a<br>
small part of that surface?<br>
<br>
or<br>
<br>
* load one PNG into a surface, and then split that surface into multiple<br>
smaller surfaces?<br>
<br>
It wasn't quite clear to me from the documentation how I should go about<br>
this.<br>
<br>
--<br>
<a href="http://frigidcode.com" target="_blank">frigidcode.com</a><br>
<a href="http://indicium.us" target="_blank">indicium.us</a><br>
<br>
<br>
<br>
<br>--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div>