Re: Packaging Image Files in the Installer

From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 07/11/04


Date: 11 Jul 2004 23:31:14 +0200


* "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/>


Relevant Pages

  • Re: KDE start menu icon (how to hack?)
    ... On 24 Apr 2005 in linux.redhat, Beowulf wrote: ... > like to see if it exists as an image file or icon file somewhere so ... Joe Makowiec ...
    (alt.linux)
  • Re: KDE start menu icon (how to hack?)
    ... > to see if it exists as an image file or icon file somewhere so I could ... > edit it. ... Lazy, lazy, for shame. ...
    (alt.linux)
  • KDE start menu icon (how to hack?)
    ... Anybody know where to find the icon for the KDE start menu? ... see if it exists as an image file or icon file somewhere so I could edit ...
    (alt.os.linux)
  • KDE start menu icon (how to hack?)
    ... Anybody know where to find the icon for the KDE start menu? ... see if it exists as an image file or icon file somewhere so I could edit ...
    (alt.os.linux.redhat)
  • KDE start menu icon (how to hack?)
    ... Anybody know where to find the icon for the KDE start menu? ... see if it exists as an image file or icon file somewhere so I could edit ...
    (linux.redhat)