The following code sample (taken from the Help entry with added "UsePNGImageDecoder()")
Code: Select all
UsePNGImageDecoder()
If LoadImage(0, OpenFileRequester("Choose an icon file", "", "", 0))
If OpenWindow(0, 200, 200, 200, 100, "Image menu Example")
If CreateImageMenu(0, WindowID(0)) ; menu creation starts....
MenuTitle("Project")
MenuItem(1, "Open" +Chr(9)+"Ctrl+O", ImageID(0))
MenuItem(2, "Save" +Chr(9)+"Ctrl+S")
MenuItem(3, "Save as"+Chr(9)+"Ctrl+A")
MenuItem(4, "Close" +Chr(9)+"Ctrl+C")
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf

ps: for beginners it might help to add a hint about the missing image decoders to the help. Or just add all image decoders. Especially for beginners, it is not good if manual examples "dont work" out of the box.

