How can I Clear an Image during run time (Newbie)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #16
    Greetings Tom!

    This should get you going. Slight modification to the code:

    Code:
    'BG ::Specific to C:\Frames\Background.gif"
    'Image1 ::Specific to Image1 = LoadPicture("C:\Frames\f1.gif") in your code
    'Image2 ::Specific to Image1 = LoadPicture("C:\Frames\f2.gif") in your code
    'Image3 ::Specific to Image1 = LoadPicture("C:\Frames\f3.gif") in your code
    
    
    Private Sub Command1_Click()
        BG.Visible = False
        Image1.Visible = True
        Image2.Visible = False
        Image3.Visible = False
    End Sub
    
    Private Sub Command2_Click()
        BG.Visible = False
        Image1.Visible = False
        Image2.Visible = True
        Image3.Visible = False
    End Sub
    
    
    Private Sub Command3_Click()
        BG.Visible = False
        Image1.Visible = False
        Image2.Visible = False
        Image3.Visible = True
    End Sub
    
    'this is where you would need to revert to blank image as needed (C:\Frames\Background.gif)
    Private Sub RefreshMenu_Click()
      Unload Me
      SingleMenu.Show
    End Sub
    
    
    'form loads with blank background snapshot set to true for visibility
    Private Sub Form_Load()
      
    BG.Visible = True 'Specific to C:\Frames\Background.gif"
    
    End Sub
    
    'Note: you should change the [B]Image frame [/B] that will be used for background to [B]BG[/B] in Name: so it is clear that Image1 = f1.gif, an so on...
    Keep the gif files the way they are. If you want, consider creating images using .bmp extension, better resolution since you have a lot of snapshots to load.

    The gif files you now have should not be (re)saved as bmp since the are already in that format, will look about the same, try for next time.

    Have fun, Tom, and good luck...

    Dököll

    Comment

    • Tomservo
      New Member
      • Mar 2007
      • 23

      #17
      Originally posted by Dököll
      Greetings Tom!

      This should get you going. Slight modification to the code:

      Code:
      'BG ::Specific to C:\Frames\Background.gif"
      'Image1 ::Specific to Image1 = LoadPicture("C:\Frames\f1.gif") in your code
      'Image2 ::Specific to Image1 = LoadPicture("C:\Frames\f2.gif") in your code
      'Image3 ::Specific to Image1 = LoadPicture("C:\Frames\f3.gif") in your code
      
      
      Private Sub Command1_Click()
          BG.Visible = False
          Image1.Visible = True
          Image2.Visible = False
          Image3.Visible = False
      End Sub
      
      Private Sub Command2_Click()
          BG.Visible = False
          Image1.Visible = False
          Image2.Visible = True
          Image3.Visible = False
      End Sub
      
      
      Private Sub Command3_Click()
          BG.Visible = False
          Image1.Visible = False
          Image2.Visible = False
          Image3.Visible = True
      End Sub
      
      'this is where you would need to revert to blank image as needed (C:\Frames\Background.gif)
      Private Sub RefreshMenu_Click()
        Unload Me
        SingleMenu.Show
      End Sub
      
      
      'form loads with blank background snapshot set to true for visibility
      Private Sub Form_Load()
        
      BG.Visible = True 'Specific to C:\Frames\Background.gif"
      
      End Sub
      
      'Note: you should change the [B]Image frame [/B] that will be used for background to [B]BG[/B] in Name: so it is clear that Image1 = f1.gif, an so on...
      Keep the gif files the way they are. If you want, consider creating images using .bmp extension, better resolution since you have a lot of snapshots to load.

      The gif files you now have should not be (re)saved as bmp since the are already in that format, will look about the same, try for next time.

      Have fun, Tom, and good luck...

      Dököll

      Thankyou for all your hard work Dököll
      Best regards
      Tom

      Comment

      • Tomservo
        New Member
        • Mar 2007
        • 23

        #18
        Originally posted by Tomservo
        Thankyou for all your hard work Dököll
        Best regards
        Tom
        Hi Dököll!
        I'm pleased as punch to report it's working fine! Thanks again.

        I put all the code in you suggested and at first it didn't work, then I realised I'd left out the "Unload Me" statement and it burst into life!...

        Then I started thinking... I hadn't used that before, so I put it with my original code (below)...and that works too! (my brain hurts now)

        I won't forget that line in a hurry!
        Thankyou Thankyou

        [CODE]
        Private Sub BackToMenu_Clic k()

        Unload Me
        SingleMenu.Show

        End Sub
        Private Sub Form_Load()

        If (SingleMenu.Com mand1) = True Then
        Image1 = LoadPicture("C: \Frames\f1.gif" )

        ElseIf (SingleMenu.Com mand2) = True Then
        Image1 = LoadPicture("C: \Frames\f2.gif" )

        ElseIf (SingleMenu.Com mand3) = True Then
        Image1 = LoadPicture("C: \Frames\f3.gif" )

        ElseIf (SingleMenu.Com mand4) = True Then
        Image1 = LoadPicture("C: \Frames\f4.gif" )

        ElseIf (SingleMenu.Com mand5) = True Then
        Image1 = LoadPicture("C: \Frames\f5.gif" )

        ElseIf (SingleMenu.Com mand6) = True Then
        Image1 = LoadPicture("C: \Frames\f6.gif" )
        End If
        [CODE]

        Comment

        • Dököll
          Recognized Expert Top Contributor
          • Nov 2006
          • 2379

          #19
          Fantastic, I am glad...Good luck with the project, Tom :-)

          In a bit!

          Dököll

          Comment

          Working...