<br><font size=2 face="sans-serif">Perfect! An instant ~2x performance
boost, and my dignity restored! :-)</font>
<br>
<br><font size=2 face="sans-serif">Thank you so much Carl for this information,</font>
<br>
<br><font size=2 face="sans-serif"> - Marty</font>
<br>
<br><tt><font size=2>Carl Worth <cworth@cworth.org> wrote on 03/06/2007
04:07:02 PM:<br>
> <br>
> So, copying the sub-piece of big_surface of interest would be as<br>
> simple as this:<br>
> <br>
> cairo_t *cr = cairo_create (small_surface);<br>
> cairo_set_source_surface (cr, big_surface, -x, -y);<br>
> cairo_rectangle (cr, 0, 0, width, height);<br>
> cairo_fill (cr);<br>
> <br>
> The interesting thing to note here, (and what will hopefully be an<br>
> "Ah-ha!" moment for some readers), is that cairo does not
have any<br>
> drawing operation that is "paint an image". Instead, cairo
has a much<br>
> more general notion where you can use an image, (or other more general<br>
> patterns, such as gradients), as the source pattern. And with that,<br>
> you can draw any shape you want, and the appropriate pieces of the<br>
> source surface will appear within that shape.<br>
> <br>
> Does that make sense? Give the above sequence a try and let us know<br>
> how it goes.<br>
> <br>
> > Congratulations on Cairo version 1.4.0. It's really a super
package.<br>
> <br>
> Thanks! I hope you have lots of fun with it.<br>
> <br>
> > p.s. I'm using rcairo on Red Hat, if that matters.<br>
> <br>
> I'm not up on ruby syntax, but hopefully it is extremely<br>
> straightforward for you to translate the above from C to ruby.<br>
> <br>
> -Carl<br>
</font></tt>