[RESOLVED] put 1 image in picturebox without need the image file
i sod some visual basic 6 projects that use pictures but without using the image file....
how can i put 1 image in picturebox and transport the project to another pc without an image file?
thanks
Re: put 1 image in picturebox without need the image file
The answer: Resource Files. Do you know how to use them?
Tutorial: http://www.thevbzone.com/l_res.htm
Read that over and pay attention to where LoadResPicture is used/discussed.
isnoend07 got there first
Insomnia is just a byproduct of, "It can't be done"
Re: put 1 image in picturebox without need the image file
There's info about resource files in my signature, but there's also inbuilt "resource file"s where you have the image hard-coded as data in the EXE file, you don't even need to have the file then. The way you do this is to set up a picturebox on your form, and set it as hidden, and set the image at DESIGN time rather than in code, that way it's automatically set from the start. You can copy the image to another picturebox if required, in code, and it's a good way to make use of an image that is regularly used :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Re: put 1 image in picturebox without need the image file
Try using a JPG that is embedded into the project itself. However lots of these will make the program slow down, chop, and then maybe crash. Also it will make your file size, greatly increase. Thats why I said, to use a JPG instead of anything else.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
Re: put 1 image in picturebox without need the image file
see these project(isn't my project)...
these project don't use resources files.... but thanks for the tutorial... it's great!!!
embedded?? what is it? how can i use it?
thanks
Last edited by joaquim; Oct 19th, 2008 at 02:54 AM.
Re: put 1 image in picturebox without need the image file
Well it the file(s) show up in the project explorer, instead of windows explorer. But I only know how to do that on Access 97 and not VB6!! But it isn't code, it is clicking with the mouse only. That part I know about.
Try looking on the Internet, about embedded media files in VB6 or try MSDN on the MS website. (Some where on it!!)
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
Re: put 1 image in picturebox without need the image file
I have just consulted my superiors.
You use the Project > Add File Menu or "Ctrl + D". And then fiddle with the controls there, and then you are able to deal with embedding media objects into it. But that is usually used for internal data files, eg: TMP, DB and etc.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
Re: put 1 image in picturebox without need the image file
Originally Posted by ThEiMp
I have just consulted my superiors.
You use the Project > Add File Menu or "Ctrl + D". And then fiddle with the controls there, and then you are able to deal with embedding media objects into it. But that is usually used for internal data files, eg: TMP, DB and etc.
i tested know that.... but i sod 1 thing.... don't put image files, but the pictureboxs has the images....
how is these possivel(i'm sorry these word is right write?(i'm portuguese))?
thanks
Re: put 1 image in picturebox without need the image file
I already suggested how to do it :-P
Put a picturebox on your form, and set the image of it to the image you want at DESIGN time...this makes it a part of the project from the start, and when you compile it the image is then stored in the file. Hide the picturebox but give it a name you can reference later and just copy from that picturebox to the picturebox you want :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Re: put 1 image in picturebox without need the image file
Originally Posted by smUX
I already suggested how to do it :-P
Put a picturebox on your form, and set the image of it to the image you want at DESIGN time...this makes it a part of the project from the start, and when you compile it the image is then stored in the file. Hide the picturebox but give it a name you can reference later and just copy from that picturebox to the picturebox you want :-)
i'm sorry... yes you have right...
what i did was:
-put the image in picturebox.
-build the *.exe file.
-change the image file name(for test it).
-then i execute the file and works fine...
thank you very much....
thanks
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Re: [RESOLVED] put 1 image in picturebox without need the image file
joaquim, if you are saving many images this way, recommend using an ImageList or Resource File instead. Why? For many images, you will have many pictureboxes, no? And dozens of pictureboxes use far more system resources in your application than are necessary, potentially making your app a system resource hog.
Insomnia is just a byproduct of, "It can't be done"
Re: [RESOLVED] put 1 image in picturebox without need the image file
Originally Posted by LaVolpe
joaquim, if you are saving many images this way, recommend using an ImageList or Resource File instead. Why? For many images, you will have many pictureboxes, no? And dozens of pictureboxes use far more system resources in your application than are necessary, potentially making your app a system resource hog.