Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

VB help plz


rockbll4's Avatar
[TheN00bHacker]
0 0

ok i'm working on a program that involves alot of images… and the program just accesses a folder thats in the same directory as the program and gets the images out of there… but is there a way to store them in the program itself? or make a single file that holds all the pictures??

plz and thnx


ghost's Avatar
0 0

sure there is. just read the image bytes. and output it in a filename. after each image print some bytes into the file so you can split it up. but then again. maybe thats to advanced for you…


rockbll4's Avatar
[TheN00bHacker]
0 0

lol eya it is…. is ther e asimpler way


rockbll4's Avatar
[TheN00bHacker]
0 0

well all the pics names are numbers so its easy to load them… cuz i just generate a random number, then load the picture and have the random number there the name goes and yea.. heres part of the code:

If radRnd.Value = True Then

    rndElement = Int(Rnd * 29) + 1
    picElement.Picture = LoadPicture(App.Path & "\images\" & rndElement & ".jpg")
    
    'see if they want the elements in order
ElseIf radOrder.Value = True Then

    
    If rndElement = 18 Then
    
        rndElement = 0
        
    End If

        'load a picture
    rndElement = rndElement + 1
    picElement.Picture = LoadPicture(App.Path & "\images\" & rndElement & ".jpg")

    
End If```

BUTTTT....
thats not my problem.. lol its just that i dont want all the pictures in a folder cuz to run that program u need THAT folder with THOSE pics...
i want to like have all them in a single file that can just go with the program without have all of the like 100 pics...

ghost's Avatar
0 0

hi, if you want the linker to add the images inside the exe, i think you can use the vb ressource editor for that purpose. been years since i used vb, but think the icon looks like a cyan colored cube or sumthin not sure. then you just add the pictures and they get an id you can use to refer to them.

if you dont find it try google 'vb resources'


ghost's Avatar
0 0

the easiest way,probably is to insert a shitload of OLE objects. every object contains a picture,or a sound,or whatever… that's vb beginner style :P

peace.

edit

and then,they're all packed into the same *.exe :happy:


rockbll4's Avatar
[TheN00bHacker]
0 0

lol thnx, i'll try the first way first and if that doesnt work

THEN

i'll try the n00b way ;)


ghost's Avatar
0 0

it's not n00bish. it uhm…lazyman-ish :P

peace…


rockbll4's Avatar
[TheN00bHacker]
0 0

lol its not 'lazy' cuz u would have to go through all the work to create a 'shitload' of ole's and they'd just get in the way ;)


ghost's Avatar
0 0

Yeah, it would look like hell if you showed the project to someone. :p