Code: Select all
;UsePNGImageDecoder()
;UseJPEGImageDecoder()
If FileSize("fcom.jpg")= -1
InitNetwork()
ReceiveHTTPFile("http://www.idlearts.com/images/legion.jpg","fcom.jpg")
EndIf
If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
;ImageGadget(0, 5, 20, 30, 230, img1, #PB_Image_Border)
img1 = LoadImage(#PB_Any,"fcom.jpg")
If img1
width = ImageWidth(img1)
height = ImageHeight(img1)
;ResizeWindow(0,0,0,width,height)
ImageGadget(0,5,20,30,230,ImageID(img1),#PB_Image_Border)
EndIf
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow ; If the user has pressed on the close button
Quit = 1
EndIf
Until Quit = 1
EndIf
End