Hi. I&#39;m using Cairo 1.8.10 (precompiled from the GTK+ for Windows page). I don&#39;t know what version of pixman, if any, it&#39;s compiled against.<br><br>My drawing code looks like this:<br><br>case WM_PAINT:<br>    {<br>
    PAINTSTRUCT ps;<br>    HDC hdc = BeginPaint(hwnd, &amp;ps);<br>    HDC memDC = CreateCompatibleDC(hdc);<br><br>    RECT rect;<br>    GetClientRect(hwnd, &amp;rect);<br>    HBITMAP newbitmap = CreateCompatibleBitmap(hdc, rect.right - rect.left, rect.bottom - rect.top);<br>
    HGDIOBJ oldbitmap = SelectObject(memDC, newbitmap);<br><br>    cairo_surface_t *surface = cairo_win32_surface_create(memDC);<br><br>    cairo_t *cr = cairo_create(surface);<br><br>    /* &gt;&gt;&gt; drawing commands go here &lt;&lt;&lt; */<br>
<br>    BitBlt(hdc, 0, 0, rect.right - rect.left, rect.bottom - rect.top, memDC, 0, 0, SRCCOPY); <br><br>    cairo_destroy(cr);<br>    <br>    cairo_surface_destroy(surface);<br><br>    SelectObject(memDC, oldbitmap);<br>
    DeleteObject(newbitmap);<br><br>    DeleteDC(memDC);<br>    EndPaint(hwnd, &amp;ps);<br>    }<br><br><div class="gmail_quote">On Mon, Jun 7, 2010 at 4:40 AM, Tim Teulings <span dir="ltr">&lt;<a href="mailto:tim@framstag.com">tim@framstag.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello!<br>
<br>
Thanks for your response!<div class="im"><br>
<br>
&gt; I&#39;m using Cairo under Windows with the same approach and have not<br>
&gt; experienced any problems with InvalidateRect. InvalidateRect  expects<br>
&gt; coordinates in what Cairo calls device space, so make sure the  rectangle you<br>
&gt; pass to InvalidateRect is defined in device space rather than user  space.<br>
&gt; Call cairo_user_to_device to convert from user space to device  space.<br>
<br></div>
I already tested converting the coordinates 10, 10 using cairo user_to_device and device_to_user conversion methods and in both cases got 10,10 back, which leads me to the assumption that user and device coordinates are the same in my case (identity matrix). Note also that the same code work perfectly if I use Windows native drawing functionality and using cairo under X11, so it is likely a problem in the interoperation between Windows and cairo.<br>

<br>
Could you send me (or point me at) the code for your windows and HDC initialization. Possibly there is a difference between your and my code that triggers my problem. Can you also state which versions of cairo and pixmap you use?<br>

<br>
-- <br>
<p>Gruß...<br>
Tim</p><br><br>--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div><br>