Bonjour,
Dans Purebasic est-il possible d'include une image dans un exe au lieu de le charger au demarrage de cet exe
Include une image dans un exe
- falsam
- Messages : 7244
- Inscription : dim. 22/août/2010 15:24
- Localisation : IDF (Yvelines)
- Contact :
Re: Include une image dans un exe
Oui avec la fonctionnalité IncludeBinary en datasection associé à CatchImage()
Code : Tout sélectionner
;Plan de l'application
Declare Start()
Declare Exit()
Start()
Procedure Start()
Protected Image = CatchImage(#PB_Any, ?image)
OpenWindow(0, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ImageGadget(1, 10, 10, 100, 30, ImageID(Image))
;Triggers
BindEvent(#PB_Event_CloseWindow, @Exit())
Repeat : WaitWindowEvent() : ForEver
EndProcedure
Procedure Exit()
End
EndProcedure
DataSection
image:
IncludeBinary #PB_Compiler_Home + "Examples\Sources\Data\PureBasic.bmp"
EndDataSection
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%