I believe there is a bug with #PB_Image_Transparent on Windows. This code works as expected on macOS. On Windows, it also oddly works fine if the image loaded was a GIF.
Code:
UsePNGImageDecoder()
UseGIFImageDecoder()
UsePNGImageEncoder()
input$ = OpenFileRequester("Select Image", "", "*.*", 0)
If input$ <> ""
img = LoadImage(#PB_Any, input$)
img2 = CreateImage(#PB_Any, ImageWidth(img), ImageHeight(img), 32)
If StartDrawing(ImageOutput(img2))
DrawAlphaImage(ImageID(img), 0, 0)
StopDrawing()
EndIf
FreeImage(img)
EndIf
OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 10, 10, 620, 460, #PB_Canvas_Border)
If StartDrawing(CanvasOutput(0))
DrawAlphaImage(ImageID(img2), 10, 10)
StopDrawing()
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow