Results 1 to 8 of 8

Thread: Is this possible?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    7

    Resolved Is this possible?

    I have about 50 pictures that I want to "inject" into my program. What I mean by this is: I don't want the program to load images locally with a file path.

    I want a picture of a cat to be displayed whenever the person clicks on button1. I want it all to be in 1 program though. I don't want to give someone a folder which contains the program and another folder which contains the picture of a cat.

    So basically, I want to have a bunch of pictures in my program which are hidden away inside of it. Is this possible? And if so, how would I do it?
    Last edited by SwaggerDownPatricia; Feb 4th, 2015 at 11:15 AM.

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Is this possible?

    You embed them as a resource.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Is this possible?

    Depending on the need of this and how you want the users to use this system. Embedding tons of large file size images is not good as it bloats your software. An alternative is to download those images from your website to the screen. And you can even take it further by downloading the image and storing it on %AppData% folder, and use that. So check if the specific image exists, if it doesn't, download a fresh pair and show it on the screen. It's real simple.

    But it's all up to you.

  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Is this possible?

    Here is a Link on how

    One thing i always do is Create a folder in my project called Resources, and then i add any images into that folder.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  5. #5
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Is this possible?

    Embedding tons of large file size images is not good as it bloats your software.
    Hmm, Your going to have to have a lot of big images for this to be an issue. If your Images are large, High resolution images then maybe don't embed them otherwise you are unlikely to have any problems.

    An alternative is to download those images from your website to the screen.
    If the images are big enough for you NOT to want to embed them, then doing it this way is going to slow down your app !
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  6. #6
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Is this possible?

    Quote Originally Posted by NeedSomeAnswers View Post
    Hmm, Your going to have to have a lot of big images for this to be an issue. If your Images are large, High resolution images then maybe don't embed them otherwise you are unlikely to have any problems.



    If the images are big enough for you NOT to want to embed them, then doing it this way is going to slow down your app !
    Download it async? Then store it on your %AppData% so it can reference it another time instead of re-downloading. But yeah, only download from a website if the file size is large like I said. If it's small then just embed to the resources.

  7. #7
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Is this possible?

    Another thought, embed the images in the program and on startup have the program check for a folder inside the user's AppData folder: %appadata%\YourAppName
    If that folder does not exist, then create it and extract all the images from inside the program to it. Then the program itself can just reference the images from the hard drive and the user is none the wiser.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    7

    Re: Is this possible?

    I've figured out what I want to do, thanks for the help everyone!

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