Results 1 to 6 of 6

Thread: I got a good one for all of you avid coders out there...

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    I have a transpearent form that has a picture image.
    I had a timer that will change the form's image at appropriate times.

    If I make an exe of the code, only the form's picture I set at design time is included, the other two images are not.

    This is the code I used to set the form's picture to other pictures:
    Me.Picture = LoadPicture("C:\WINDOWS\SYSTEM\NTLocked.jpg")

    'as you can see, I am using a path to the images, I know there must be a better way.

    How can I keep all three image files inside the EXE ?

    I appreciate any time and efforts,
    Daniel Christie

  2. #2
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Put three invisible image controls (preferably as an array) on your form with the desired images in them.

    In your timer event put something like this

    private sub Timer1_Timer
    static intIndex as integer

    'This makes the app cycle through the images
    intIndex = Mod(intIndex + 1, 3)

    Me.picture = imgImage(intIndex).Picture
    Me.Refresh

    end sub

    (This is untested code, I typed it straight in here)
    That should do it I guess.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  3. #3
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Use the resource manager in VB. Add the pics to a resource file and use GetPicture etc to load them up.

    (see MSDN for exact details)
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  4. #4
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Yes, MLewis's suggestion is better, but I wasn't sure if Daniel_Christie had the Professional Edition or better. I was told that only those versions had a resource manager.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  5. #5
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Nah, go to Microsoft's web site and you can download the resource manager, class builder, all kinds of stuff for learning edition/academic edition/etc and it works fine.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  6. #6

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Thanks guys, I appreciate your posts...

    I am running VB5 Enterprise Edition.

    Daniel Christie

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