Pour changer directement la couleur de fond, aucune idée, par contre, rien ne t'empèche de mettre une ImageGadget dans la GadgetList et de dessiner dedans.
Code : Tout sélectionner
; On charge une police de caractères
IdFont = LoadFont(10,"Arial",72)
; On crée deux images avec la couleur du fond et le texte
If CreateImage(100,400,400)
StartDrawing(ImageOutput())
Box(0,0,200,200,RGB($0,$0,$FF))
Box(200,0,200,200,RGB($FF,$0,$0))
Box(0,200,200,200,RGB($FF,$0,$0))
Box(200,200,200,200,RGB($0,$0,$FF))
DrawingMode(1): FrontColor(255,0,255):DrawingFont(IdFont)
Locate(10,140) : DrawText("Bonjour")
StopDrawing()
EndIf
If CreateImage(101,400,400)
StartDrawing(ImageOutput())
Box(0,0,200,200,RGB($0,$80,$0))
Box(200,0,200,200,RGB($FF,$0,$FF))
Box(0,200,200,200,RGB($FF,$0,$FF))
Box(200,200,200,200,RGB($0,$80,$0))
DrawingMode(1): FrontColor(128,255,64):DrawingFont(IdFont)
Locate(10,140) : DrawText("Bonjour")
StopDrawing()
EndIf
;On ouvre la fenêtre
If OpenWindow(0,0,0,305,140,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ScrollAreaGadget")
If CreateGadgetList(WindowID(0))
ScrollAreaGadget(0, 10, 10,290,120, 400, 400, 30)
;On place une ImageGadget dans la GadgetList
;et on affiche la première image
ImageGadget(1,0,0,400,400,UseImage(100))
CloseGadgetList()
EndIf
Start = ElapsedMilliseconds()
Repeat
If ElapsedMilliseconds() >= Start+1000
If a = 101 : a = 100 : Else : a = 101 : EndIf
; Pour changer l'image, on utilise SetGadgetState()
SetGadgetState(1,UseImage(a))
Start = ElapsedMilliseconds()
EndIf
Select WindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf