how to reference image
-
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
-
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
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) -
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)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"); } }
-
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"); } }
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 toEmbeddedResource
. 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)