Why the image is not showing on the GUI?

Just starting out? Need help? Post your questions and find answers here.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Why the image is not showing on the GUI?

Post by stmdbe2019 »

Why the image is not showing?

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
-----
Registered PureBasic Coder.
Denis
Enthusiast
Enthusiast
Posts: 778
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Why the image is not showing on the GUI?

Post by Denis »

It's a gif file format.

Use UseGIFImageDecoder()
A+
Denis
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Re: Why the image is not showing on the GUI?

Post by stmdbe2019 »

Thank you. It worked.
-----
Registered PureBasic Coder.
Post Reply