Revision: 6284
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6284&view=rev
Author: jdh2358
Date: 2008-10-20 16:19:51 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Applied Lee's backend wx patch
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-10-20
14:16:05 UTC (rev 6283)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-10-20
16:19:51 UTC (rev 6284)
@@ -96,6 +96,7 @@
import sys, os, os.path, math, StringIO, weakref, warnings
+import numpy as npy
# Debugging settings here...
# Debug level set here. If the debug level is less than 5, information
@@ -333,6 +334,23 @@
gfx_ctx.StrokePath(wxpath)
gc.unselect()
+ def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
+ if bbox != None:
+ l,b,w,h = bbox.bounds
+ else:
+ l=0
+ b=0,
+ w=self.width
+ h=self.height
+ rows, cols, image_str = im.as_rgba_str()
+ image_array = npy.fromstring(image_str, npy.uint8)
+ image_array.shape = rows, cols, 4
+ bitmap = wx.BitmapFromBufferRGBA(cols,rows,image_array)
+ gc = self.get_gc()
+ gc.select()
+ gc.gfx_ctx.DrawBitmap(bitmap,int(l),int(b),int(w),int(h))
+ gc.unselect()
+
def draw_text(self, gc, x, y, s, prop, angle, ismath):
"""
Render the matplotlib.text.Text instance
@@ -482,7 +500,7 @@
"""
if sys.platform=='win32':
- self.SelectObject(self.bitmap)
+ self.dc.SelectObject(self.bitmap)
self.IsSelected = True
def unselect(self):
@@ -490,7 +508,7 @@
Select a Null bitmasp into this wxDC instance
"""
if sys.platform=='win32':
- self.SelectObject(wx.NullBitmap)
+ self.dc.SelectObject(wx.NullBitmap)
self.IsSelected = False
def set_foreground(self, fg, isRGB=None):
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins