From: pyt...@bdurham.com
To: "zz Python Win32 Newsgroup" <python-win32@python.org>
Subject: [python-win32] Win API call to display a BMP/PNG file as a
       splash screen for a console app?
Message-ID: <1269295703.32357.1366163...@webmail.messagingengine.com>
Content-Type: text/plain; charset="us-ascii"

>>Is there a Windows API call I can use to display a BMP or a PNG
>>file in a window centered on a user's display? This function
>>would be called from a console app to display a splash screen.

I don't know, but I suspect not.
>>complexity of a full GUI framework like wxPython or pyQT and
To do this in wxPython is approximately 10 lines of code, maybe 20 at the
most.
Actually- the # of lines to do this in wxPython is less than your original
email.


class SketchApp(wx.App):

    def OnInit(self):
        bmp = wx.Image("splash.png").ConvertToBitmap()
        wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                1000, None, -1)
        wx.Yield()

        frame = SketchFrame(None)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True

if __name__ == '__main__':
    app = SketchApp(False)
    app.MainLoop()


This is barebones, taken from wxPython In Action- ideally you should have
some minimal exception handling
to make your app more robust.
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to