<div><br>void PaintDeviceCairo::BlitToMemory(MemoryImage&amp; image, const ClipRect&amp; rect)<br>{<br>&nbsp;&nbsp;&nbsp; int width = cairo_image_surface_get_stride(m_surface);<br>&nbsp;&nbsp;&nbsp; char* target = (char*)image.buffer + image.pitch * rect._y + rect._x * sizeof(UINT);<br>&nbsp;&nbsp;&nbsp; char* pixels = (char*)cairo_image_surface_get_data(m_surface) + <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; width * rect._y + rect._x * sizeof(UINT);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; for(int _y = 0; _y &lt; rect._h; _y ++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; memcpy(target, pixels, sizeof(UINT) * rect._w);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pixels += width;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; target += image.pitch;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>I'd like a cairo surface part of the draw into the memory, but I found that 
always show all black. Why? <br>Note: This memory is D3D SURFACE<br></div><br><br><span title="neteasefooter"/><hr/>
<a href="http://allyes.nie.163.com/main/adfclick?db=afanie&bid=1254,611,23&cid=145,4,1&sid=1351&show=ignore&url=http://tx2.163.com/fab.html">09年新晋3D主流网游《天下贰》,网易六年亿资打造</a>
</span>