Am 24.04.2009, 22:54 Uhr, schrieb Miles Lee <[email protected]>: > import wx > import wx.lib.floatcanvas.floatcanvas2 as fc > > class MyFrame(wx.Frame): > def __init__(self,p): > wx.Frame.__init__(self,p, -1, ) > panel = wx.Panel(self, -1) > self.SetBackgroundColour('WHITE') > > canvas = fc.NavCanvas(self) > #take a screen shot > image_background = canvas.getScreenshot('jpg') > > #panel.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) > #self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnErase) > def OnErase(self, evt): > pass > #evt.Skip() > if __name__ == '__main__': > app = wx.App(False) > frame = MyFrame(None) > frame.Show(True) > app.MainLoop() > > Did I use it correctly?
Yes. Please update svn, I committed a fix. First I reworked the render surface code a bit. I hope this does not break Mac/Linux again... Then I added an optional renderFirst parameter to the getScreenshot function. By default it is true which means the canvas gets re-rendered before you take the screenshot. This is mostly useful if you have changed the canvas, but it hasn't been re-rendered yet. -Matthias _______________________________________________ FloatCanvas mailing list [email protected] http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
