By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

Packaging Image Files in the Installer

P: n/a
I saw an article, once, on how to package image file in the installer so
they are not accessible to the end user. I want to say hidden, but I don't
just mean the file attribute of the image file. Does anyone know of the
article I'm speaking of or a link on how to embed (another poor choice of
words) the image files in the executable?

Thanks,
John
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
* "jcrouse" <me> scripsit:
I saw an article, once, on how to package image file in the installer so
they are not accessible to the end user. I want to say hidden, but I don't
just mean the file attribute of the image file. Does anyone know of the
article I'm speaking of or a link on how to embed (another poor choice of
words) the image files in the executable?


Description of the necessary steps for embedding an icon file, other
image formats will work similar:

Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Currently this is the way I have things setup. I have an installer in my
project. I added a folder to the installer package and added all of the
image files to the installer package folder. I the declare the in the code
and then call them.

Dim myImage as New Bitmap(Application.StartupPath & "\Images")
PictureBox.Image = myImage

When I embed the in the executable and then remove them for the installer
package folder, how do I then reference them in my code? Also, should they
be disposed of when the form is closed and the image is no longer being
used. I'm talking about fifty or sixty images here and am concerned with
system resource usage.

On a side note. I also have my icon files and banner images for the
installer package in the same above mentioned folder. How do I embed them.
The properties page in the dialog boxes of the installer package seems to
only allow yout o look in the folder you have setup in the installer
package.

Thank you,
John
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Ou**************@TK2MSFTNGP12.phx.gbl...
* "jcrouse" <me> scripsit:
I saw an article, once, on how to package image file in the installer so
they are not accessible to the end user. I want to say hidden, but I don't just mean the file attribute of the image file. Does anyone know of the
article I'm speaking of or a link on how to embed (another poor choice of words) the image files in the executable?


Description of the necessary steps for embedding an icon file, other
image formats will work similar:

Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

P: n/a
* "jcrouse" <me> scripsit:
Currently this is the way I have things setup. I have an installer in my
project. I added a folder to the installer package and added all of the
image files to the installer package folder. I the declare the in the code
and then call them.

Dim myImage as New Bitmap(Application.StartupPath & "\Images")
PictureBox.Image = myImage

When I embed the in the executable and then remove them for the installer
package folder, how do I then reference them in my code? Also, should they
be disposed of when the form is closed and the image is no longer being
used. I'm talking about fifty or sixty images here and am concerned with
system resource usage.
If you load them like I load the images in the sample I posted in the
previous message, you can/should dispose the images when you don't need
them any more.
On a side note. I also have my icon files and banner images for the
installer package in the same above mentioned folder. How do I embed them.


I don't know that.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
Oops, sorry I didn't notice your code. I tried it but don't understand the
[Assembly] parameter. Should I add an assembly to my project and somehow add
the image (jpg) files to the assembly?

Thanks,
John

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Of**************@TK2MSFTNGP09.phx.gbl...
* "jcrouse" <me> scripsit:
Currently this is the way I have things setup. I have an installer in my
project. I added a folder to the installer package and added all of the
image files to the installer package folder. I the declare the in the code and then call them.

Dim myImage as New Bitmap(Application.StartupPath & "\Images")
PictureBox.Image = myImage

When I embed the in the executable and then remove them for the installer package folder, how do I then reference them in my code? Also, should they be disposed of when the form is closed and the image is no longer being
used. I'm talking about fifty or sixty images here and am concerned with
system resource usage.
If you load them like I load the images in the sample I posted in the
previous message, you can/should dispose the images when you don't need
them any more.
On a side note. I also have my icon files and banner images for the
installer package in the same above mentioned folder. How do I embed

them.
I don't know that.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5

P: n/a
Resolved! New thread started for installer packaging.
"jcrouse" <me> wrote in message news:ed*************@TK2MSFTNGP09.phx.gbl...
I saw an article, once, on how to package image file in the installer so
they are not accessible to the end user. I want to say hidden, but I don't
just mean the file attribute of the image file. Does anyone know of the
article I'm speaking of or a link on how to embed (another poor choice of
words) the image files in the executable?

Thanks,
John

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.