c# 不能在代码中的资源中使用图像?
c# can't use image in resources in the code?
我想在我的应用程序中使用图像。
我添加了 4 张这样的图片:
WindowsAplication1-Resources-Images-add Existing file (select my images )
然后我可以在 window 中看到它们,也可以在解决方案资源管理器中看到它们。
但是当我使用这个命令来使用图像时
pictureBox2.Image = Prooerties.Resources.**** (I don't see the images)
这是为什么?
我做错了什么?
谢谢,
也许这会对你有所帮助
pictureBox2.Image = global::(SolutionName).Properties.Resources.(ImageName);
确保将 (SolutionName) 和 (ImageName) 更改为您的
pictureBox2.Image = global::(namespace).Resources.****
在命名空间
中检查"Project - Properties - Resources.resx - Resources.Designer.cs"
里面会有"class Resources"
我想在我的应用程序中使用图像。
我添加了 4 张这样的图片: WindowsAplication1-Resources-Images-add Existing file (select my images ) 然后我可以在 window 中看到它们,也可以在解决方案资源管理器中看到它们。
但是当我使用这个命令来使用图像时
pictureBox2.Image = Prooerties.Resources.**** (I don't see the images)
这是为什么?
我做错了什么?
谢谢,
也许这会对你有所帮助
pictureBox2.Image = global::(SolutionName).Properties.Resources.(ImageName);
确保将 (SolutionName) 和 (ImageName) 更改为您的
pictureBox2.Image = global::(namespace).Resources.****
在命名空间
中检查"Project - Properties - Resources.resx - Resources.Designer.cs"里面会有"class Resources"