Elliptic Splash/Intro Window

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Elliptic Splash/Intro Window

Post by BackupUser »

Code updated for 5.20+

Restored from previous forum. Originally posted by Franco.

Code: Select all

; (c) 2001 - Franco's template - absolutely freeware
; Elliptic Splash/Intro Window
; Improved Version

Procedure SplashElliptic(SizeX,SizeY,BMP$,Time)
  ;InitGadget(0)
  If LoadImage(0, BMP$)
    If OpenWindow(0, GetSystemMetrics_(#SM_CXSCREEN), GetSystemMetrics_(#SM_CYSCREEN), SizeX, SizeY, "Test Intro", #WS_POPUP)
      SetForegroundWindow_(WindowID(0))
      SetWindowPos_(WindowID(0),#HWND_TOPMOST,(GetSystemMetrics_(#SM_CXSCREEN)/2)-(WindowWidth(0)/2),(GetSystemMetrics_(#SM_CYSCREEN)/2)-(WindowHeight(0)/2),SizeX,SizeY, SWP_NOMOVE)
      ImageGadget(0, ((SizeX)/2)-(ImageWidth(0)/2), ((SizeY)/2)-(ImageHeight(0)/2), 0, 0, ImageID(0))
      Elliptic.l=CreateEllipticRgn_(0,0,SizeX,SizeY)
      SetWindowRgn_(WindowID(0),Elliptic,1)
      WindowEvent() : WindowEvent() ; Thanks to Mr.Skunk :)
      Delay(Time)
      DeleteObject_(Elliptic)
      CloseWindow(0)
      ProcedureReturn 1
    EndIf
  Else
    ProcedureReturn 0
  EndIf
EndProcedure

If SplashElliptic(220,130,"C:\PureBasic\Examples\Sources\Data\Geebee2.bmp",3000) ;change path to point to desired picture file
Else : MessageRequester("Error","No Splash Window",0)
EndIf

If OpenWindow(0, GetSystemMetrics_(#SM_CXSCREEN), GetSystemMetrics_(#SM_CYSCREEN), 320, 240, "Test Intro", #PB_Window_SystemMenu)
  SetWindowPos_(WindowID(0),#HWND_TOPMOST,(GetSystemMetrics_(#SM_CXSCREEN)/2)-(WindowWidth(0)/2),(GetSystemMetrics_(#SM_CYSCREEN)/2)-(WindowHeight(0)/2),320,240, 0 )
  Repeat
    EventID = WaitWindowEvent()
  Until EventID = #PB_Event_CloseWindow
EndIf

End
Have a nice day...
Franco


Edited by - Franco on 18 October 2001 23:16:26
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Simply cool, Thanx :)

Fred - AlphaSND
Post Reply