Results 1 to 11 of 11

Thread: How can I embed 3 image files inside my apps exe?

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    I have a transpearent form thathas 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
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    try including the gifs in picboxes...

    how about having 2 more picboxes and put the images there and then save ur project, then copy the .frx of the form and open ur form in notepad so tht u can copy the address locator... ooops...
    sorry.

    --------------------------
    do this:

    put 2 picboxes in ur form and put the pics in them.
    save ur project.
    rename ur form1.frx to something.frx
    open the form.frm in notepad

    and copy the foolowing lines:
    Code:
    ...
          Picture         =   "Form1.frx":0000
    ...
          Picture         =   "Form1.frx":274FA
    ...
          Picture         =   "Form1.frx":D74DD
    ...
    then u can open ur form and take out the new picboxes and then save ur project.

    then last step is to change ur load to:

    picture1.picture = loadpicture("Form1.frx":0000) 'first
    picture1.picture = loadpicture("Form1.frx":274FA) 'second
    picture1.picture = loadpicture("Form1.frx"74DD) 'third

    and u just have to replace ur new form1.frx
    with ur old form.frx... then compile.... it should work...

    if u need any help... ask!
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  3. #3
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    whhops the are the same as : and D
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  4. #4
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    picture1.picture = loadpicture("Form1.frx":0000) 'first
    picture1.picture = loadpicture("Form1.frx":274FA) 'second
    picture1.picture = loadpicture("Form1.frx"74DD) 'third

    is...

    picture1.picture = loadpicture("Form1.frx":0000) 'first
    picture1.picture = loadpicture("Form1.frx":274FA) 'second
    picture1.picture = loadpicture("Form1.frx": D74DD) 'third
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    MoMad, you can switch off the smileys when writing a post... would be easier than making spaces

    Or if you dont want to disable them do it like me:

    picture1.picture = loadpicture("Form1.frx":D74DD)

    *hehe*

  6. #6
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    ooops...

    the stuff i wrote in the above does not work!!!!

    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  7. #7
    New Member
    Join Date
    Apr 2001
    Location
    London
    Posts
    1
    You could just have three or four Pictureboxes in a control array with their .Visible property set to False if required, on your form.

    Then when you need to change the form's image, just set it to the picturebox's.

    Form1.Picture = Picture(1).Picture
    Form1.Picture = Picture(2).Picture

  8. #8
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    thats a good one and it works much better because you can load a picture into a form and so on.... then the form cab read it.

    i coulnt get my samples to work so thanks for the help trickster.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  9. #9
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    OOPS...... Late Reply!!!!!

    Hi...

    HeHeeeHeee

    Sorry if i'm replying too late. the fact is i've seen this post TOO LATE.


    but anyway I think its better to have an imagelist on the form with all the three images stored in it and u can access them whenever u want.

    I hope this should also work.

    Cute Member

  10. #10
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    Just load all the pictures in pictureboxes and have one picturebox for the 'animation', then use picAnimation.Picture = picFrame1.Picture.... couldn't be easier!

    An ImageList requires you to use the ComCtl.ocx, which is an extra 1 MB when distributing. So unless you're using the other components too it's just a waste of space...
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  11. #11
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625

    Another Sollution

    hey how about having one form that only has images... imgboxes or picboxes then all you need to do is:

    picSomething.Picture = frmImges.picSmile.Picture

    you can also do:
    frmImages.picTemp.Picture = LoadPicture(App.Path & "/myPic.xxx")
    'where xxx is a valid extention...
    'then do,
    picLoaded.Picture = frmImages.picTemp.Picture

    does that make sense?

    sorry about the confusion, but when i first answered this post i was thinking about something else. Now i know exactly what you mean because i did something similar... except mine also allowed people to load pictures into the program... and the program had around 50 unique images... all stollen from the internet, but dont worry its just a school project, nothing commercial.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

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