Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx, urllib
- class Test(wx.Frame):
- def __init__(self, parent, id):
- wx.Frame.__init__(self, parent, id, "Test App", (800, 800))
- self.panel = wx.Panel(self)
- self.panel.SetBackgroundColour("#FFFFFF")
- self.Centre()
- #show local image
- '''self.image = wx.Image("Untitled.png", wx.BITMAP_TYPE_ANY)
- self.imageBitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, wx.Bitmap(self.image))'''
- #show image from URL
- self.URL = "http://maps.googleapis.com/maps/api/staticmap?sensor=false¢er=42.6510766,23.3828383&size=640x480&format=PNG&zoom=16&markers=size:normal|color:green|42.6510766,23.3828383"
- urllib.urlretrieve(self.URL, "image.jpg")
- self.image = wx.Image("image.jpg", wx.BITMAP_TYPE_ANY)
- self.imageBitmap = wx.StaticBitmap(self.panel, wx.ID_ANY, wx.Bitmap(self.image))
- def main():
- app = wx.App()
- frame = Test(None, -1)
- frame.Show()
- app.MainLoop()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement