Notifications
Clear all

[Closed] Swap a image in a rollout window ?

Can you swap a image in a rollout window ? something like this ;

if (test == 1) do ( foopic = “redpic.gif”)
if (test == 0) do ( foopic = “greenpic.gif”)
bitmap bmp1 loadfile:foopic pos:[20,20] width:15 height:15

Ive been playing around for a bit but nto got anything working yet so any help would be great thanks

2 Replies

<bitmap>.fileName String
The bitmap item file name as a string. You can change the image at any time by setting this property to a new name, but it will not resize the display area in the rollout; it will always be the size set from the initial image.

Looks like you should be able to. The following worked for me:


rollout test "testing"

(

local file1 = "e:\	mp\	est2.jpg"

local file2 = "e:\	mp\	est.jpg"



local x = bitmap 100 67 filename:file1

local y = bitmap 100 67 filename:file2

bitmap a filename:file1 bitmap:x



button myButton "change bitmap"



on myButton pressed do

(

if a.filename == file1 then

(

a.filename = file2

)

else

(

a.filename = file1

)

print "clicked!"

)

)

 

createdialog test


[left]
[/left]

Thanks I will give that a go

yep that works fine Thanks again