|
-
Nov 19th, 2005, 08:26 AM
#1
Thread Starter
Lively Member
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.
-
Nov 19th, 2005, 11:44 AM
#2
Fanatic Member
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
-
Nov 19th, 2005, 06:24 PM
#3
Thread Starter
Lively Member
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...
-
Nov 19th, 2005, 07:28 PM
#4
Re: show me a code to this simple graphics situation
What language are you using?
Bill
-
Nov 20th, 2005, 12:54 AM
#5
Thread Starter
Lively Member
Re: show me a code to this simple graphics situation
visual basic 6.0, please post a code.
-
Nov 20th, 2005, 08:38 AM
#6
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|