Question : How to "bundle" a Logo.bmp image in a VB.Net Windows Forms app

In a Windows Forms app I'm loading a logo.bmp file from a shared network drive using the UNC path.  
I want to make the app more portable, i.e. able to run outside our corporate network where the shared folder is.
I need to make the logo.bmp file part of the installation.  To do that I think I need to add the .bmp file as a "Resource" in the Project Propertis, but I'm not quite sure of the correct procedure to do that.

The logo.bmp file is already in the root of my project folder, but I don't have a "resources" folder and the logo.bmp is not listed in "Resources" in my Project Properties.

Here is how I'm currenty doing it.  What I need to do is copy that logo.bmp into the Signatures folder of the person running the app (path2).
1:
2:
3:
4:
5:
6:
Dim path2 As String = "C:\Documents and Settings\" & eV & "\Application Data\Microsoft\Signatures\WF1Logo.bmp"
        Dim sourceFileName As String = "\\storserve\common\WorkForceOneSignature\WF1Logo.bmp"
        If Not (File.Exists(path2)) Then
            Dim destinationFileName As String = "C:\Documents and Settings\" & eV & "\Application Data\Microsoft\Signatures\WF1Logo.bmp"
            FileSystem.CopyFile(sourceFileName, destinationFileName)
        End If

Answer : How to "bundle" a Logo.bmp image in a VB.Net Windows Forms app

You can embend the bitmap logo into your application using resources.

In the main VB IDE menu under Projects > ProjectName Properties... The new window will appear under the "Resources" tab you can add an image resource. Choose Add Resource >> Add Existing File.. locate your logo bitmap to load into the resource manager. Select it an on the properties page change persistance to "Embedded in .resx" look on your main solution explorer you should see a "Resources" folder select the image and on that properties dialog under "Build Action" select the "Embedded Resource" from the dropdown.

1:
2:
3:
4:
5:
Dim myLogo As Bitmap = Nothing
myLogo = New Bitmap(My.Resources._3_5_Disk_Drive)
myLogo.Save("3.5_Disk_Drive.png")' change save path
myLogo.Dispose()
myLogo = Nothing
Random Solutions  
 
programming4us programming4us