Results 1 to 10 of 10

Thread: [RESOLVED] Loading bmp's

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Resolved [RESOLVED] Loading bmp's

    I have a folder with 163 bmp's and they each have different names. Is there a way to load these into an Image Clip or a Picture Clip at run time? I do not want to load each one individually. Thanks in advance.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Loading bmp's

    You could simply load them in a loop by using DIR(). About altering the loading order: what's the criteria you want to apply to define the loading order? for example if you want to load them alphabetically, one way would be loading all the file paths into array, sorting the array and then loading all pics in a loop.
    Last edited by jcis; Dec 12th, 2013 at 09:11 PM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: Loading bmp's

    Thank you jcis;

    Your answer has given me enough so I can work it out now...Thank you

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Loading bmp's

    No problem, tell us if you need more help, i've been posting loops like this using DIR() some weeks ago.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] Loading bmp's

    You say:

    Quote Originally Posted by TheOldNewbie View Post
    I have a folder with 163 bmp's and they each have different names. Is there a way to load these into an Image Clip or a Picture Clip at run time? I do not want to load each one individually. Thanks in advance.
    But now the thread is resolved by a suggestion to do the very thing you said you didn't want to?

  6. #6
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED] Loading bmp's

    Quote Originally Posted by dilettante View Post
    But now the thread is resolved by a suggestion to do the very thing you said you didn't want to?
    By "I do not want to load each one individually" I assume he means he doesn't want to add LoadPicture() in code once for every Picture he wants to load, or else, what would be the reason for him to refuse to use a simple loop to load Pictures? that's why I adviced about using DIR() in a loop. Anyway, i never used the PictureClip component, it might have some method to directly load multiple files from a given folder.
    Last edited by jcis; Dec 12th, 2013 at 11:30 PM.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] Loading bmp's

    No, it doesn't. The whole point is to load a single composite image to save vast amounts of memory and GDI handles.

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: [RESOLVED] Loading bmp's

    163 images don't use that many GDI handles.
    Last edited by Niya; Dec 13th, 2013 at 08:03 AM. Reason: Correction: Changed 'do' to "don't"
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] Loading bmp's

    You have to remember the days when people ran Windows in 24MB of RAM... or even 4MB in some cases.

    http://support.microsoft.com/kb/138349

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    77

    Re: [RESOLVED] Loading bmp's

    Guys;

    I meant that I did not want to load each one at design time. I had not used Dir() in so long I overlooked it. When jcis suggested it, it "rung a bell". I used Dir() and it worked perfectly. Thanks to all...

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