Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem With Embedded Resources Inside A user Control

Problem With Embedded Resources Inside A user Control

Scheduled Pinned Locked Moved Visual Basic
helpgraphicshardware
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Herbertmunch
    wrote on last edited by
    #1

    HI all! When designing a control, i embedded some pictures into the project. But when i try to access them i get no joy! the thing is the code i use works fine on just a standard project, but when i try it in the control, no stream is returned! The namespace im using is correct, and ive even tried putting the resourses in both the usercontrol project and the test project! Heres the code i use for standard projects: Public Function GetEmbeddedImage(ByVal AppForm As Object, ByVal strImageName As String) As Bitmap Dim Exec_Assem As [Assembly] = AppForm.GetType.Assembly.GetEntryAssembly Dim myNameSpace As String = Exec_Assem.GetName.Name.ToString Dim PicStream As Stream Dim BMP As Bitmap PicStream = Exec_Assem.GetManifestResourceStream(myNameSpace + "." + strImageName) BMP = New Bitmap(PicStream) GetEmbeddedImage = BMP.Clone() BMP.Dispose() PicStream.Close() End Function :((:((:confused: the only differnce in code i use when calling from the usercontrol is : GetEntryAssembly Instead of which i use GetExecuting Assembly as this returns the user control assembly instead of the test project assembly. Thanks for your help!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups