show me a code to this simple graphics situation
I have two images where i am going to put in the Image Control... I want this image to change every a second to their respective design...
example:
first image: parrot.jpg
second image: eagle.jpg
first second, parrot.jpg will display in the image control, next second will be the eagle.jpg... vice versa... can you display a code for me like this...
thanks in advance.
Re: show me a code to this simple graphics situation
VB Code:
Private Sub Form_Load()
Me.Show
Static start_time As Double
Image1.Visible = True
Do Until i = 3
start_time = Timer
Do Until Timer - start_time > 1
Loop
Image1.Visible = False
Image2.Visible = True
Me.Refresh
i = i + 1
start_time = Timer
Do Until Timer - start_time > 1
Loop
Image2.Visible = False
Image1.Visible = True
Me.Refresh
Loop
End Sub
Hope that helps
Re: show me a code to this simple graphics situation
the code above hangs my computer when i am trying to run the program. is there any solution or code? please post. how about using picturebox instead of imagebox... please be in details so that i can fully understand the coding and procedures. thanks...
Re: show me a code to this simple graphics situation
What language are you using?
Bill
Re: show me a code to this simple graphics situation
visual basic 6.0, please post a code.
Re: show me a code to this simple graphics situation
VB Code:
Private Sub Form_Load()
Me.Show
Static start_time As Double
Image1.Visible = True
Me.Refresh
Do Until i = 2
start_time = Timer
Do Until Timer - start_time > 1
Loop
Image1.Visible = False
Image2.Visible = True
Me.Refresh
i = i + 1
start_time = Timer
Do Until Timer - start_time > 1
Loop
Image2.Visible = False
Image1.Visible = True
Me.Refresh
Loop
End Sub
This may look like the same code, but its not I made one change, try this one. Use Image controls and select the picture and make the visible propertys false for both. This code will show the pictures 4 times then you can exit.
You can modify this code for you needs too. If you didnt want it to hang on a loop to wait you could do
VB Code:
123
start_time = timer
do while whatever
.
.
all your code
.
.
if timer - start_time > 1 then
switch boxes
goto 123
end if
.
.
more code
.
.
loop