Please update LoadImage example "Help Text" code
Posted: Wed Nov 02, 2022 5:20 pm
The ImageGadget() help text needs to be updated. The help text does not mention using one or all of the Decoders(). Please update it to this:
It's up to the programmer which decoder to use but without an applicable decoder the LoadImage fails and never talks about it in the help text!
I am testing this on Mac but I think the same results happen on Windows.
Code: Select all
UseJPEGImageDecoder()
UseTGAImageDecoder()
UsePNGImageDecoder()
UseTIFFImageDecoder()
UseGIFImageDecoder()
If OpenWindow(0, 0, 0, 245, 105, "ImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If LoadImage(0, "map.bmp") ; change 2nd parameter to the path/filename of your image
ImageGadget(0, 10, 10, 100, 83, ImageID(0)) ; imagegadget standard
ImageGadget(1, 130, 10, 100, 83, ImageID(0), #PB_Image_Border) ; imagegadget with border
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I am testing this on Mac but I think the same results happen on Windows.