[cairo] Can cairo work with win32 SetMapMode

fiveight fiveight at tom.com
Tue Aug 19 00:59:38 PDT 2014


Hi All:

I am using cairo on win7 with MFC.

In OnDraw function, I call SetMapMode with MM_LOMETRIC parameter, like this:

void CCairoWindowView::OnDraw(CDC* pDC)
{
	pDC->SetMapMode(MM_LOMETRIC);
	
	cairo_surface_t* surface =
		cairo_win32_surface_create(pDC->GetSafeHdc());
	cairo_t *cr =
		cairo_create (surface);
	cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
	double x1 = 0;
	double y1 = 0;
	cairo_device_to_user(cr,&x1,&y1);
	cairo_move_to(cr,x1,y1);
	double x2 = 400;
	double y2 = -400;
	cairo_device_to_user(cr,&x2,&y2);
	cairo_line_to(cr,x2,y2);
	cairo_stroke(cr);
	cairo_destroy(cr);
	cairo_surface_destroy (surface);

}

But there is nothing displayed in client.

Can cairo work with win32 SetMapMode?
 				

        fiveight
        fiveight at tom.com
          2014-08-19


More information about the cairo mailing list