Image transparency on a PureBasic form
Posted: Sun May 12, 2024 7:23 pm
Would someone mind confirming if LoadImage() and ImageGadget() support the concept of transparency and if JPG transparency is supported? I can't seem to find an example image to try and there doesn't appear to be much in the way of reference to this, other than briefly in the documentation that says it isn't supported for BMPs. Thanks.
Code: Select all
EnableExplicit
UseJPEGImageDecoder()
Define Window_0 = OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 590, 240, "Test Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Define Button_0 = ButtonGadget(#PB_Any, 40, 170, 130, 25, "Update", #PB_Button_Default)
Define Button_1 = ButtonGadget(#PB_Any, 190, 170, 130, 25, "Cancel")
Define Img_Window_0_0 = LoadImage(#PB_Any,"MyImage.JPG")
Define Image_0 = ImageGadget(#PB_Any, 360, 20, 193, 84, ImageID(Img_Window_0_0))
Define event
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0
Case Button_1
End
EndSelect
EndSelect
ForEver
CloseWindow(Window_0)