[cairo] dimensionally accurate drawings on screen ?

John Ellson ellson at research.att.com
Fri Jan 20 11:57:57 PST 2006

This isn't a cairo problem, I'm sure, but I'm hoping that someone here will
know how to solve it.

I'm trying to create dimensionally accurate drawings using cairo on a 
GdkDrawable using

	GdkDrawable *drawable;
	cairo_t *cr;
	drawable = gtk_drawing_area_new();
        cr = gdk_cairo_create  (drawable);

I can generate the drawings ok.  Its the dimensionally accurate part I'm having difficultly with.

I'd like to scale according to accurate xy resolution values.  With Xlib I know I can obtain the
resolution with:
	resolution.x = DisplayWidth(dpy, scr) / DisplayWidthMM(dpy, scr);
	resolution.y = DisplayHeight(dpy, scr) / DisplayHeightMM(dpy, scr);

but how can I get from "GdkDrawable *display"  to the "Display* dpy" and the "int scr" ?

Thanks in advance for any hints.


More information about the cairo mailing list