Hi
I have created different shapes like circle/rect etc in my program using BufferedPaintDC on event. Now i want to save the file as I click the saveas button in the menu option. For that I am using memoryDC and save the contents as bmp file.
def Saveas(self,event):
dlg = wx.FileDialog(self, "Choose a file", self.dirname, "", "*.*", \
wx.SAVE | wx.OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK: # user enters filename as something.bmp
self.show_bmp = wx.StaticBitmap(self)
w, h = self.GetClientSize()
draw_bmp = wx.EmptyBitmap(w, h)
c = wx.MemoryDC(draw_bmp)
c.SetBrush(wx.Brush('white'))
c.Clear()
c.SetPen(wx.Pen("purple", 15))
c.DrawRectangle(30,30,60,60) ### ??????####
myimage = self.show_bmp.GetBitmap()
self.filename=dlg.GetFilename()
name = os.path.join('C:\mad', self.filename)
myimage.SaveFile(name, wx.BITMAP_TYPE_JPEG)
self.filename=name
dlg.Destroy()
Now my problem is how do I get the things drawn by the buffered dc on the " c ", so that they can be then converted to image?? I hope my question is clear.As u can see I am drawing the rectangle on the "c" and that is being converted to an image. But I want to get the shapes created on ONPaint . How do I extract that?
Thanks