From: Darran E. <da...@ed...> - 2007-10-29 20:45:11
|
Michael Droettboom wrote: > I'm assuming you're using the Agg backend. If so, you can get the raw > memory wrapped in a Python buffer object as follows: > figureCanvas.get_renderer().buffer_rgba(x, y) > (where x, y is the upper left corner in the plot of the area you want to > get.) It should be possible in C side to then get the address out of > that using the Python/C API. Hi Mike. I am using the above API call. What I'm hoping to avoid is having to copy this buffer to a ctypes buffer. buff = figureCanvas.buffer_rgba(0,0) cbuffer[:] = buff[:] ## would prefer to eliminate this step address = ctypes.addressof(cbuffer) ptr = ogre.CastVoidPtr(address) This question probably belongs on the pythonOgre mailing list. Thanks though. Cheers, Darran. -- Darran Edmundson [da...@ed...] http://www.edmstudio.com |