I have a small problem of display : to compare the behavior of two graphs, I created two "images" in a window to draw a graph in each image. The problem is that only the window and its two images display at once, but graphs appear only if I minimize the window to open again it then, either that I "move" it out of the screen, to return it in the middle of the screen ??!!
To show you what I made, I simplified the program by replacing graphs by one "BOX" and a "CIRCLE".
Could anybody say to me what I badly programmed ?
And also, a supplementary question: why images numbers are the same?
Thank you in advance for your help !!
Sospel
--------------------------------------------------------------
Here is my program :
Code: Select all
;
; open window n°0 : ----------------------------------------
;
ValOptions = 0
ValOptions = ValOptions | #PB_Window_SystemMenu
ValOptions = ValOptions | #PB_Window_MinimizeGadget
ValOptions = ValOptions | #PB_Window_SizeGadget
N_WinMain = 0
winhight.F = 680
winlarg.F = winhight * Sqr(2)
title$ = "MAIN WINDOW"
OpenWindow(N_WinMain,20,20,winlarg,winhight,title$, ValOptions)
SetWindowColor(N_WinMain, RGB(192, 83, 70))
H_WinMain = WindowID(N_WinMain)
CreateGadgetList(H_WinMain)
;
; open "image" n°1 ------------------------------------
N_Image1 = 1
imaghight.F = winhight * 0.90
imaglarg.F = winlarg * 0.45
CreateImage(N_Image1,imaglarg,imaghight,32)
ImageGadget(N_Image1,10,20,0,0,ImageID(N_Image1))
ident1 = ImageOutput(N_Image1)
If StartDrawing(ImageOutput(N_Image1))
Box (80,20,100,200,RGB(221, 120, 34))
DrawText(100,30,Str(ident1),RGB(0,0,0))
StopDrawing()
EndIf
;
; open "image" n°2 -------------------------------------
N_Image2 = 2
imaghight.F = winhight * 0.60
imaglarg.F = winlarg * 0.45
CreateImage(N_Image2,imaglarg,imaghight,32)
ImageGadget(N_Image2,500,100,0,0,ImageID(N_Image2))
ident2 = ImageOutput(N_Image2)
If StartDrawing(ImageOutput(N_Image2))
Circle (120,150,90,RGB($40,$40,$FF))
DrawText(100,100,Str(ident2),RGB(0,0,0))
StopDrawing()
EndIf
;
Repeat
Until WaitWindowEvent () = #PB_Event_CloseWindow
;
End