Hi all,
i've made a widget that emulate a Matrix Display. I use this method to draw
the background on the screen:
def _doMatrix(self, dc):
w, h = self.GetSize()
self._selColours(self.fgColour, dc)
x = y = 0
for x in range(w/4):
for y in range(h/4):
self._drawXY(x,y,dc)
def _drawXY(self,x,y,dc):
dc.DrawRectangle((x*4)+2, (y*4)+2, 3, 3)
and, when i need to refresh if (content change) i use this method:
def Refresh(self):
dc = wx.PaintDC(self)
self._selColours(self.bgColour, dc)
w, h = self.GetSize()
dc.DrawRectangle(0, 0, w, h)
self._doMatrix(dc)
self._doUpdate(dc)
In detail i use a bidimensional array to track matrix content: if MyArray[x]
[y] is TRUE, then i draw that "pixel" in black, howewer stay unmodified.
The problem is that is TOO SLOW !!!! Can i use another method to do the same
thing ?
N.B. Here's a GPLed project. Here the link:
http://www.zerozone.it/Software/wxPython/LEDMatrix.tar.gz
Thanks !
···
--
------
O-Zone ! www.zerozone.it