[cairo] How to crop image surface?

Marty Sherrill Marty.Sherrill at celera.com
Mon Mar 5 11:52:09 PST 2007


Hello all,

I'm looking for help understanding how to crop an image (or otherwise set 
its dimensions) in memory just after it's drawn.  I'm drawing images that 
need to be different sizes according to their content, and it's not 
practical to figure out the dimensions before doing the actual drawing.

I have the idea in mind to draw on a larger-than-necessary surface, track 
the extents of my drawing, and then crop off the extra space.

Is that a good approach?  If so, could I get some advice as to how the 
cropping step can be accomplished?

Best regards,

 - Marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070305/b52b6586/attachment.htm


More information about the cairo mailing list