Results 1 to 14 of 14

Thread: *resolved* HELPPPPPP How can I add images to my program?

Hybrid View

  1. #1
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    well..create a folder called pictures(just to not mess up all your project) then drag and drop ALL pictures to that folder and there is somewhere a option that will embedded them in the .EXE..hope this helps
    edit: omg i suck, now i see that this already had been talked about..i have somewhere a function in VB.NET which gets a resource ill look up for it wait some min plz
    edit2: hope this helps,
    VB Code:
    1. Private Function GetResource(ByVal filename As String) As System.IO.Stream
    2.         Dim oAssembly As Reflection.Assembly = MyClass.GetType.Assembly
    3.         Dim sFiles() As String
    4.         Dim sFile As String
    5.         ' prefix filename with namespace
    6.         filename = oAssembly.GetName.Name & "." & filename
    7.         ' get a list of all embeded files
    8.         sFiles = oAssembly.GetManifestResourceNames()
    9.         ' loop through each file
    10.         For Each sFile In sFiles
    11.             ' found the file? return the stream
    12.             If sFile = filename Then
    13.                 Return oAssembly.GetManifestResourceStream(sFile)
    14.             End If
    15.         Next
    16.     End Function
    Last edited by PT Exorcist; Apr 13th, 2003 at 07:48 AM.
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width