Results 1 to 11 of 11

Thread: How to embed images in Executables (.EXE) files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    How to embed images in Executables (.EXE) files

    Hello,

    I don't know as to where I should post this question so I am posting it here.

    It for the first time that I am asking for help so if I have made any mistake Mods please correct it.

    Ok.

    I have been assigned a task to build an Image cataloger. In this cataloger user can create as many catalogs as necessary then export a catalog to an Executable (.EXE) file. This means an EXE file in which all images of selected catalog are embedded.

    Users then now can distribute this EXE file to anyone.

    The EXE when run will show all the images embedded into it as a full screen slide show one my one. The original images are not required!

    How can I do this in VB6? Any idea please? A coding sample will be better.

    TIA

    Yogi Yang
    Last edited by yogiyang; Aug 3rd, 2010 at 09:43 AM. Reason: I think I need to expand my question for better understanding

  2. #2

    Re: How to embed images in Executables (.EXE) files

    Hi Yogiyang, this is Nicole Miller from vWorker.com (formerly known as Rentacoder.com). Have you tried looking for sample code at planet-source-code? Or soliciting the code as a homework project of some sort?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by RACNicole View Post
    Have you tried looking for sample code at planet-source-code?
    To be frank I have not checked. What keywords should I use to search such a sample on PSC? Please guide me.

    TIA

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: How to embed images in Executables (.EXE) files

    What programming language are you using, and what exactly are you trying to achieve? In VB6 for example, images you set in PictureBoxes or for Form's background picture will be compiled into the exe. There's also an ImageList control.

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to embed images in Executables (.EXE) files

    Embedding a large number of large resources into an EXE isn't really advisable. It would usually be better to create a separate "image store" which could be a simple binary file that has a header up front containing the picture names, sizes and their offsets following the header. That would also let you have a generic EXE for viewing such "albums."

    This means two files instead of a single EXE, but without the penalties of having an oversized EXE.

    These (EXE plus an album) can be distributed as a single-file self extracting archive. You may want this anyway because the EXE may have dependencies that require distribution as well.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by baja_yu View Post
    What programming language are you using, and what exactly are you trying to achieve? In VB6 for example, images you set in PictureBoxes or for Form's background picture will be compiled into the exe. There's also an ImageList control.
    As you may have read my original post. What I want is to allow user of my software to be able to export their albums to self running/showing EXEs. For this to be possible I have to embed images in EXE file or as suggested by dilettante I can instead create a separate binary file which will store all the images in it. I have already implemented this by my client wants it his way and this way is to embed images in EXE which will show the images as slide show on target PC.

    Hope you understood as to what I want?

  7. #7

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by yogiyang View Post
    To be frank I have not checked. What keywords should I use to search such a sample on PSC? Please guide me.

    TIA
    I'm not sure yogiyang. I would try "embed images in exe" I do know that there's a sea of code over there so you're bound to run into something useful.

    -Nicole

  8. #8
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by yogiyang View Post
    As you may have read my original post. What I want is to allow user of my software to be able to export their albums to self running/showing EXEs. For this to be possible I have to embed images in EXE file or as suggested by dilettante I can instead create a separate binary file which will store all the images in it. I have already implemented this by my client wants it his way and this way is to embed images in EXE which will show the images as slide show on target PC.

    Hope you understood as to what I want?
    Wiat, you mean 'inject' images into an already compiled exe file?!

    Attached is a sample project based on my original idea.
    Attached Files Attached Files

  9. #9
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: How to embed images in Executables (.EXE) files

    Sounds like you want an EXE to create an EXE. That is not practical. I would suggest writing a program that show a slideshow that retrieves the images in a specific location (could be a directory or a single file). Then write another program that puts the images into your choice of viewer formats.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by baja_yu View Post
    Wiat, you mean 'inject' images into an already compiled exe file?!
    Yes you got it! That is exactly what I want.

    Quote Originally Posted by baja_yu View Post
    Attached is a sample project based on my original idea.
    Thanks for the sample but it is not what I want.

    Regards,

    Yogi Yang

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    Re: How to embed images in Executables (.EXE) files

    Quote Originally Posted by RACNicole View Post
    I'm not sure yogiyang. I would try "embed images in exe" I do know that there's a sea of code over there so you're bound to run into something useful.

    -Nicole
    Thanks for the tip. I did try to search on parallel lines but did not come up with anything really useful so I thought I will ask for your help.

    Once again Thanks.

    Regards,

    Yogi Yang
    Last edited by yogiyang; Aug 9th, 2010 at 08:36 AM.

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