|
Post by grovesy on Sept 2, 2004 14:15:57 GMT
Is there a way to set the image of an Image box after the image box has been created?
For example you can set the text in a text box using
GUI_SETTEXT(GadgetName,Text$)
Is there such thing as
GUI_SETIMAGE(GadgetName,Image)
Thanks guys
|
|
|
Post by WendellM on Sept 12, 2004 6:18:04 GMT
The trick seems to be the undocumented GUI_BoxImage() function which is found in XGfx.bb. I put together a test program using a couple of 50x50 jpgs and was able to swap them out with the code fragment below:
Img1 = LoadImage("TestImg1.jpg") Img2 = LoadImage("TestImg2.jpg")
TestBox = GUI_IMGBOX(Window,16,100,50,50,Img1)
GUI_OPENWIN(Window) GUI:Flip ;The box shows Img1 at this point
WaitKey
GUI_BOXIMAGE(Object.Gad(TestBox),Img2) GUI_REFRESH(Window) GUI:Flip ;The box now shows Img2 Edit: It also seems like you can use "GUI_REFRESH_IMGAREA(Object.Gad(TestBox))" in place of "GUI_REFRESH(Window)"
|
|