(bind-func cairo_draw_image
(lambda (cr:cairo_surface_t* image:cairo_surface_t* sx sy sw:double sh:double dx dy dw dh)
(let ((scalex (/ dw sw))
(scaley (/ dh sh)))
(cairo_save cr)
(cairo_scale cr scalex scaley)
(cairo_set_source_surface cr image (- (* dx scalex) (* 1.0 sx)) (- (* dy scaley) (* 1.0 sy)))
(cairo_rectangle cr (/ dx scalex) (/ dy scaley) (/ dw scalex) (/ dh scaley))
(cairo_fill cr)
(cairo_restore cr)
void)))