[cairo] translating from coordinates to user space

Matt Bartolome mattxbart at gmail.com
Tue Mar 10 11:05:37 PDT 2009

I'm new to cairo and had a couple questions about scale. What I would
like to do is draw my image in the data's geographic coordinate system
then translate it to pixel space. Lets say the extent of the data is
2000,1000, 4000, 2000 (xmin,ymin,xmax,ymax). Once I have finished
drawing all the vectors in that coordinate system I would like to just
translate it to a 0,0 origin with appropriate x and y max so it fits
on the image (using svgsurface). Or, maybe even scale the drawing to a
predefined width like 1200px 400px and distort the x and y to fit the
space. I've been looking at the scale and translate functions but I
don't quite get it.

Does anybody have an example of this type of thing? Any advice would
be appreciated!


More information about the cairo mailing list