Posted: Mon Jun 01, 2009 4:20 am
If you're wanting a splash screen to fade in against the desktop background before your DX screen opens, a borderless layered window with your bmp as a background brush (or image gadget) would work fine. There should be examples of this on the forums.
Simple demo:
Simple demo:
Code: Select all
UseJPEGImageDecoder()
LoadImage(0,#PB_Compiler_Home+"examples\sources\data\r2skin.jpg")
OpenWindow(0,0,0,512,512,"",#PB_Window_BorderLess|#PB_Window_ScreenCentered|#PB_Window_Invisible)
SetWindowLong_(WindowID(0),#GWL_EXSTYLE,GetWindowLong_(WindowID(0),#GWL_EXSTYLE)|#WS_EX_LAYERED|#WS_EX_TOOLWINDOW)
hBrush = CreatePatternBrush_(ImageID(0))
SetClassLong_(WindowID(0),#GCL_HBRBACKGROUND,hBrush)
InvalidateRect_(WindowID(0),0,1)
HideWindow(0,0)
alpha=0
Repeat
ev=WindowEvent()
If ev=#PB_Event_CloseWindow:End:EndIf
SetLayeredWindowAttributes_(WindowID(0),0,alpha,#LWA_ALPHA)
alpha+1
Delay(20)
Until alpha=255 Or GetAsyncKeyState_(#VK_SPACE)&32768
t=ElapsedMilliseconds()
Repeat
ev=WindowEvent()
If ev=#PB_Event_CloseWindow:End:EndIf
Until ElapsedMilliseconds()-t>=2000 Or GetAsyncKeyState_(#VK_SPACE)&32768
CloseWindow(0)
DeleteObject_(hBrush)
; Open screen and go on