je fait qq test et je butes sur un problème d'accès à une ImageGadget, voici le code
Code : Tout sélectionner
Enumeration
#Window_0
EndEnumeration
Enumeration
#Image_0
#ImageDescription
#Image_1
#ImageSaisie
#Button_0
EndEnumeration
;InitSprite()
;-création de l'image de fond
#WIDTH = 377
#HEIGHT = 81
If CreateImage(#ImageDescription,#WIDTH,#HEIGHT)
StartDrawing(ImageOutput(#ImageDescription))
x = 0
w = #WIDTH
y = 0
h = #HEIGHT
Box(x,y,w,h,RGB(0, 0, 0))
StopDrawing()
EndIf
If CreateImage(#ImageSaisie,#WIDTH,25)
StartDrawing(ImageOutput(#ImageSaisie))
x = 0
w = #WIDTH
y = 0
h = 25
Box(x,y,w,h,RGB(0, 0, 50))
StopDrawing()
EndIf
;-Main
If OpenWindow(#Window_0, 200, 100, 509, 316 , "Saisie Graphique", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar)
If CreateGadgetList(WindowID(#Window_0))
ImageGadget(#Image_0, 8, 168, #WIDTH, #HEIGHT, ImageID(#ImageDescription)) ;, #PB_Image_Border)
ImageGadget(#Image_1, 8, 249, #WIDTH, 25, ImageID(#ImageSaisie))
ButtonGadget(#Button_0, 360, 80, 50, 40, "OK")
EndIf
quitMain_Form=0
Repeat
EventID =WaitWindowEvent()
MenuID =EventMenu()
GadgetID =EventGadget()
WindowID =EventWindow()
Select EventID
Case #PB_Event_CloseWindow
If WindowID=#Window_0
quitMain_Form=1
EndIf
Case #PB_Event_Gadget
Select GadgetID
Code : Tout sélectionner
Case #Button_0
StartDrawing(ImageOutput(#ImageDescription))
DrawText(3,15,"testouille",RGB(255,255,255))
Plot(3,3,RGB(255,255,255))
Plot(4,4)
Plot(5,5)
StopDrawing()
EndSelect
EndSelect
Until quitMain_Form
CloseWindow(#Window_0)
EndIf

si qq'un a une idée, d'avance merci
