Exemplo n.º 1
0
 def OnInit(self):
     wx.Image_AddHandler(wx.JPEGHandler())
     wx.Image_AddHandler(wx.PNGHandler())
     wx.Image_AddHandler(wx.GIFHandler())
     frame = DemoFrame(None)
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
Exemplo n.º 2
0
 def OnInit(self):
     """
     Start the game
     """
     #import locale
     #self.locale = wx.Locale(wx.LANGUAGE_FRENCH)
     #locale.setlocale(locale.LC_ALL, 'fr')
     wx.Image_AddHandler(wx.PNGHandler())
     frame = PokerFrame(None)
     frame.Show(True)
     self.SetTopWindow(frame)
     #wx.InitAllImageHandlers()
     return True
Exemplo n.º 3
0
    def __init__(self, parent, delay):
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "Splash",
                          style=wx.FRAME_FLOAT_ON_PARENT | wx.NO_BORDER)

        if not SplashWindow.inited:
            SplashWindow.inited = True
            wx.Image_AddHandler(wx.JPEGHandler())

            self.loadQuotes(parent)

        self.pickRandomQuote()

        self.pic = misc.getBitmap("resources/logo.jpg")

        if self.pic.Ok():
            w, h = (self.pic.GetWidth(), self.pic.GetHeight())
        else:
            w, h = (375, 300)

        util.setWH(self, w, h)
        self.CenterOnScreen()

        self.textColor = wx.Colour(255, 255, 255)

        self.font = util.createPixelFont(14, wx.FONTFAMILY_MODERN, wx.NORMAL,
                                         wx.NORMAL)

        self.quoteFont = util.createPixelFont(16, wx.FONTFAMILY_DEFAULT,
                                              wx.NORMAL, wx.NORMAL)

        self.sourceFont = util.createPixelFont(15, wx.FONTFAMILY_DEFAULT,
                                               wx.FONTSTYLE_ITALIC, wx.NORMAL)

        if delay != -1:
            self.timer = wx.Timer(self)
            wx.EVT_TIMER(self, -1, self.OnTimer)
            self.timer.Start(delay, True)

        wx.EVT_LEFT_DOWN(self, self.OnClick)

        wx.EVT_PAINT(self, self.OnPaint)
        wx.EVT_CLOSE(self, self.OnCloseWindow)
Exemplo n.º 4
0
def AddImageHandler(type):
    d = {
        "bmp": wx.BMPHandler,
        "png": wx.PNGHandler,
        "jpg": wx.JPEGHandler,
        "gif": wx.GIFHandler,
        "pcx": wx.PCXHandler,
        "pnm": wx.PNMHandler,
        "tiff": wx.TIFFHandler,
        #"iff": wx.IFFHandler,
        #"xpm": wx.XPMHandler,
        "ico": wx.ICOHandler,
        "cur": wx.CURHandler,
        "ani": wx.ANIHandler,
    }
    key = type.lower()
    handler = d[key]
    wx.Image_AddHandler(handler())
    _handlers[key] = 1
Exemplo n.º 5
0
        super(LGBITImageHandler, self).__init__()
        self.SetName('LG BIT Image')
        self.SetExtension('bit')
        self.SetType(BITMAP_TYPE_LGBIT)

    def GetImageCount(self, _):
        return 1

    def LoadFile(self, image, stream, verbose, index):
        return False
    def SaveFile(self, image, stream, verbose):
        return False
    def DoCanRead(self, stream):
        return False

wx.Image_AddHandler(BCIImageHandler())

if __name__=='__main__':
    import sys

    app=wx.PySimpleApp()
    if len(sys.argv)==2:
        f=Display(sys.argv[1])
    elif len(sys.argv)==3:
        bciconvert(sys.argv[1], sys.argv[2])
        f=Display(sys.argv[2])
    else:
        assert Exception, "not enough params"
    
    app.MainLoop()