def OnSize(self, event):
# The buffer is initialized in here, so that the buffer is always
# the same size as the Window.
if event is None:
return 0,0
width, height = self.GetClientSize()
if width <= 0 or height <=0:
return 0,0
# Make new off-screen bitmap: this bitmap will always have the
# current drawing in it, so it can be used to save the image to
# a file, or whatever.
if width and height:
# Macs can generate events with 0-size values
self._buffer = wx.Bitmap(width, height)
self.UpdateDrawing()
评论列表
文章目录