Click to See Complete Forum and Search --> : How can I embed 3 image files inside my apps exe?
Daniel_Christie
Nov 1st, 2000, 11:16 PM
I have a transpearent form thathas a picture image.
I had a timer that will change the form's image at appropriate times.
If I make an exe of the code, only the form's picture I set at design time is included, the other two images are not.
This is the code I used to set the form's picture to other pictures:
Me.Picture = LoadPicture("C:\WINDOWS\SYSTEM\NTLocked.jpg")
'as you can see, I am using a path to the images, I know there must be a better way.
How can I keep all three image files inside the EXE ?
I appreciate any time and efforts,
Daniel Christie
MoMad
Nov 2nd, 2000, 02:41 PM
how about having 2 more picboxes and put the images there and then save ur project, then copy the .frx of the form and open ur form in notepad so tht u can copy the address locator... ooops...
sorry.
--------------------------
do this:
put 2 picboxes in ur form and put the pics in them.
save ur project.
rename ur form1.frx to something.frx
open the form.frm in notepad
and copy the foolowing lines:
...
Picture = "Form1.frx":0000
...
Picture = "Form1.frx":274FA
...
Picture = "Form1.frx":D74DD
...
then u can open ur form and take out the new picboxes and then save ur project.
then last step is to change ur load to:
picture1.picture = loadpicture("Form1.frx":0000) 'first
picture1.picture = loadpicture("Form1.frx":274FA) 'second
picture1.picture = loadpicture("Form1.frx":D74DD) 'third
and u just have to replace ur new form1.frx
with ur old form.frx... then compile.... it should work...
if u need any help... ask! :p
MoMad
Nov 2nd, 2000, 02:42 PM
whhops the :D are the same as : and D
MoMad
Nov 2nd, 2000, 02:51 PM
picture1.picture = loadpicture("Form1.frx":0000) 'first
picture1.picture = loadpicture("Form1.frx":274FA) 'second
picture1.picture = loadpicture("Form1.frx":D74DD) 'third
is...
picture1.picture = loadpicture("Form1.frx":0000) 'first
picture1.picture = loadpicture("Form1.frx":274FA) 'second
picture1.picture = loadpicture("Form1.frx": D74DD) 'third
Fox
Nov 2nd, 2000, 03:25 PM
MoMad, you can switch off the smileys when writing a post... would be easier than making spaces ;)
Or if you dont want to disable them do it like me:
picture1.picture = loadpicture("Form1.frx":D74DD)
*hehe* :)
MoMad
Nov 2nd, 2000, 03:53 PM
the stuff i wrote in the above does not work!!!!
trickster
Apr 16th, 2001, 04:36 AM
You could just have three or four Pictureboxes in a control array with their .Visible property set to False if required, on your form.
Then when you need to change the form's image, just set it to the picturebox's.
Form1.Picture = Picture(1).Picture
Form1.Picture = Picture(2).Picture
MoMad
Apr 16th, 2001, 12:10 PM
thats a good one and it works much better because you can load a picture into a form and so on.... then the form cab read it.
i coulnt get my samples to work so thanks for the help trickster.
cutamacious
May 11th, 2001, 06:24 AM
Hi...
HeHeeeHeee :D
Sorry if i'm replying too late. the fact is i've seen this post TOO LATE.
but anyway I think its better to have an imagelist on the form with all the three images stored in it and u can access them whenever u want.
I hope this should also work.
:cool: :cool: :cool: :D :D
PsychoMark
May 11th, 2001, 06:52 AM
Just load all the pictures in pictureboxes and have one picturebox for the 'animation', then use picAnimation.Picture = picFrame1.Picture.... couldn't be easier! :)
An ImageList requires you to use the ComCtl.ocx, which is an extra 1 MB when distributing. So unless you're using the other components too it's just a waste of space...
MoMad
May 11th, 2001, 11:32 AM
hey how about having one form that only has images... imgboxes or picboxes then all you need to do is:
picSomething.Picture = frmImges.picSmile.Picture
you can also do:
frmImages.picTemp.Picture = LoadPicture(App.Path & "/myPic.xxx")
'where xxx is a valid extention...
'then do,
picLoaded.Picture = frmImages.picTemp.Picture
does that make sense?
sorry about the confusion, but when i first answered this post i was thinking about something else. Now i know exactly what you mean because i did something similar... except mine also allowed people to load pictures into the program... and the program had around 50 unique images... all stollen from the internet, but dont worry its just a school project, nothing commercial. :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.