def save(self,path,image_type): w,h = self.GetSizeTuple() bitmap = wx.wxEmptyBitmap(w,h) dc = wx.wxMemoryDC() dc.SelectObject(bitmap) #self.update() # The background isn't drawn right without this cluge. #fill_color = get_color(self.background_color) fill_color = get_color('white') dc.SetPen(wx.wxPen(fill_color)) dc.SetBrush(wx.wxBrush(fill_color)) #how to handle transparency??? dc.DrawRectangle(0,0,w,h) dc.SetPen(wx.wxNullPen) dc.SetBrush(wx.wxNullBrush) # end cluge self.draw(dc) image = wx.wxImageFromBitmap(bitmap) wx.wxInitAllImageHandlers() image.SaveFile(path,image_type_map[image_type])
def getGetMinusImage(): return wxImageFromBitmap(getGetMinusBitmap())
def getGetHandImage(): return wxImageFromBitmap(getGetHandBitmap())
def getProjectImage(): return wxImageFromBitmap(getProjectBitmap())
def getPlusImage(): return wxImageFromBitmap(getPlusBitmap())
def getLogoBigImage(): return wxImageFromBitmap(getLogoBigBitmap())
def getFile1Image(): return wxImageFromBitmap(getFile1Bitmap())
def getLogoSmallImage(): return wxImageFromBitmap(getLogoSmallBitmap())