Teste diese mal.
Wenn es funktioniert, muss was an deinen Path zum bild mit stimmen
Wenn es nicht funktioniert, muss was an der installation von PB was nicht stimmen.
Code: Alles auswählen
;-TOP
UseJPEGImageDecoder()
Enumeration
#Image1
#Image2
EndEnumeration
Procedure UpdateWindow()
Protected dx, dy
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
; Resize Gadgets
CopyImage(#Image1, #Image2)
ResizeImage(#Image2, dx - 20, dy - 20)
ResizeGadget(0, 10, 10, dx - 20, dy - 20)
SetGadgetState(0, ImageID(#Image2))
EndProcedure
Procedure InitProgram()
Protected path.s
path = #PB_Compiler_Home + "examples/3d/Data/Textures/" + "terrain_texture.jpg"
If Not LoadImage(#Image1, path)
MessageRequester("Error", "Load Image " + path)
End
EndIf
EndProcedure : InitProgram()
Procedure Main()
Protected dx, dy
#WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "Test Window", #WinStyle)
; MenuBar
CreateMenu(0, WindowID(0))
MenuTitle("File")
; StatusBar
CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
CopyImage(#Image1, #Image2)
ResizeImage(#Image2, dx - 20, dy - 20)
ImageGadget(0, 10, 10, dx - 20, dy - 20, ImageID(#Image2), #PB_Image_Border)
; Bind Events
BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
; Main Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ForEver
EndIf
EndProcedure : Main()