Results 1 to 6 of 6

Thread: show me a code to this simple graphics situation

  1. #1

    Thread Starter
    Lively Member neo_phyte's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Philippines
    Posts
    71

    Lightbulb 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.

  2. #2
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: show me a code to this simple graphics situation

    VB Code:
    1. Private Sub Form_Load()
    2. Me.Show
    3. Static start_time As Double
    4. Image1.Visible = True
    5. Do Until i = 3
    6. start_time = Timer
    7. Do Until Timer - start_time > 1
    8. Loop
    9.  
    10. Image1.Visible = False
    11. Image2.Visible = True
    12. Me.Refresh
    13. i = i + 1
    14. start_time = Timer
    15. Do Until Timer - start_time > 1
    16. Loop
    17. Image2.Visible = False
    18. Image1.Visible = True
    19. Me.Refresh
    20. Loop
    21.  
    22. End Sub
    Hope that helps

  3. #3

    Thread Starter
    Lively Member neo_phyte's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Philippines
    Posts
    71

    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...

  4. #4
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: show me a code to this simple graphics situation

    What language are you using?

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  5. #5

    Thread Starter
    Lively Member neo_phyte's Avatar
    Join Date
    Nov 2005
    Location
    Cebu, Philippines
    Posts
    71

    Re: show me a code to this simple graphics situation

    visual basic 6.0, please post a code.

  6. #6
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: show me a code to this simple graphics situation

    VB Code:
    1. Private Sub Form_Load()
    2. Me.Show
    3. Static start_time As Double
    4. Image1.Visible = True
    5. Me.Refresh
    6. Do Until i = 2
    7. start_time = Timer
    8. Do Until Timer - start_time > 1
    9. Loop
    10.  
    11. Image1.Visible = False
    12. Image2.Visible = True
    13. Me.Refresh
    14. i = i + 1
    15. start_time = Timer
    16. Do Until Timer - start_time > 1
    17. Loop
    18. Image2.Visible = False
    19. Image1.Visible = True
    20. Me.Refresh
    21. Loop
    22.  
    23. 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:
    1. 123
    2. start_time = timer
    3. do while whatever
    4. .
    5. .
    6. all your code
    7. .
    8. .
    9. if timer - start_time > 1 then
    10. switch boxes
    11. goto 123
    12. end if
    13. .
    14. .
    15. more code
    16. .
    17. .
    18. 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
  •  



Click Here to Expand Forum to Full Width