How to add/deploy Images in C#/.NET (Visual Studio)
You can add images as resources to the project. The images will be stored as part of your solution and get deployed when you deploy your solution. To add an image to the project, select Resources Tab from Project Properties and click on Add Resources; Select an appropriate file
Resources Tab in Visual Studio
Once the image is added it will be displayed as shown below:
The resource file is part of your project as shown below:
To access the image from code use the following
public System.Drawing.Bitmap GetButtonImage(Office.IRibbonControl control) { switch(control.Id) { case "btnmoscow": return Properties.Resources.moscow; . . , default: return null; } }
No comments:
Post a Comment