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. C#
  4. how to reference image

how to reference image

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelptutorial
4 Posts 2 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.
  • N Offline
    N Offline
    netJP12L
    wrote on last edited by
    #1

    Hi fellows, I created a "Class Library project" in Visual Studio and added a "Windows Applications" project to the same solution. The problem is that I added a referece to the Class Library dll file to my Windows appication project and I don't see images. Images resides in the ClassLibrary project. What i want is that when a dll class is reference in any project and instiantated. It should display image that is define in it's assembly. Thanks in advance

    D 1 Reply Last reply
    0
    • N netJP12L

      Hi fellows, I created a "Class Library project" in Visual Studio and added a "Windows Applications" project to the same solution. The problem is that I added a referece to the Class Library dll file to my Windows appication project and I don't see images. Images resides in the ClassLibrary project. What i want is that when a dll class is reference in any project and instiantated. It should display image that is define in it's assembly. Thanks in advance

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      We would need to see how you are embedding/retrieving the images in the class library and how you are exposing them to other apps.

      Dave

      If this helped, please vote & accept answer!

      Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

      N 1 Reply Last reply
      0
      • D DaveyM69

        We would need to see how you are embedding/retrieving the images in the class library and how you are exposing them to other apps.

        Dave

        If this helped, please vote & accept answer!

        Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

        N Offline
        N Offline
        netJP12L
        wrote on last edited by
        #3

        I have two projects in one solution. What I want to do is that whenever I instantiate CusomPicture class it should show a picture that is inside this project class. How could i tell the ProjectB CustomPicture class that upon its run look for Logo.gif inside its own project. Project A using CustomPicture; private void Form1_Load(object sender, EventArgs e) { CustomPicture cp = new CustomPicture(); } Project B public class CustomPicture { public customPicture() { PictureBox.Image=new Bitmap("Logo.gif"); } }

        D 1 Reply Last reply
        0
        • N netJP12L

          I have two projects in one solution. What I want to do is that whenever I instantiate CusomPicture class it should show a picture that is inside this project class. How could i tell the ProjectB CustomPicture class that upon its run look for Logo.gif inside its own project. Project A using CustomPicture; private void Form1_Load(object sender, EventArgs e) { CustomPicture cp = new CustomPicture(); } Project B public class CustomPicture { public customPicture() { PictureBox.Image=new Bitmap("Logo.gif"); } }

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          Goto ProjectB properties and select Resources. Add a resource file if prompted then drag and drop the files into there. Depending on how you want to package the images you may want to set their BuildAction properties to EmbeddedResource. Your constructor would then be something like:

          PictureBox.Image = Properties.Resources.Logo;

          Dave

          If this helped, please vote & accept answer!

          Binging is like googling, it just feels dirtier. Please take your VB.NET out of our nice case sensitive forum.(Pete O'Hanlon)
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

          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