Ich habe hier folgenden Code:
Code: Alles auswählen
UseTGAImageDecoder()
If LoadImage(1,"logo.tga") = 0
MessageRequester("Fehler","Die Datei konnte nicht gefunden werden",#MB_ICONSTOP)
End
EndIf
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Image_0
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 220, 0, 600, 300, "New window ( 0 )", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
ImageGadget(#Image_0, 10, 20, 600, 140, ImageID(1))
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Image_0
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;

Wenn ich die Datei aber in ein mit PureBasic erstelltes Fenster lade, sieht es so aus:

Was mache ich falsch?
P.S.: An alle "nicht-Gimp Benutzer": Das grau gekästelte bedeutet Transparenz.