Ken McIvor wrote: > The problem I foresee is that the Agg renderer's RGBA data has to > be converted to RGB before a wxImage can be created by convert_agg2image().
As if by magic, this from Robin Dunn today: > You may want to take a look at my CVS commits for the last couple weeks. > I've now got some raw bitmap access code in place. Both 2.6 and 2.7 will > have wx.BitmapFromBuffer and wx.BitmapFromBufferRGBA factory functions which > can copy from a buffer object directly into the bitmap's pixel buffer, and > 2.7 will also have wx.NativePixelData and wx.AlphaPixelData which allow > direct access to the pixel buffer from Python. (The latter needed a bug fix > that I'm not sure (yet) can be backported to 2.6...) For example, I can now > do this (in a PyShell): > > >>> import wx > >>> import numarray > >>> f = wx.Frame(None) > >>> p = wx.Panel(f) > >>> dc = wx.ClientDC(p) > >>> f.Show() > >>> dim=100 > >>> R=0; G=1; B=2; A=3 > >>> arr = numarray.array(shape=(dim, dim, 4), typecode='u1') > >>> for row in xrange(dim): > ... for col in xrange(dim): > ... arr[row,col,R] = 0 > ... arr[row,col,G] = 0 > ... arr[row,col,B] = 255 > ... arr[row,col,A] = int(col * 255.0 / dim) > ... > >>> bmp = wx.BitmapFromBufferRGBA(dim, dim, arr) > >>> dc.DrawBitmap(bmp, 20, 20, True) This is looking pretty promising. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel