从C#项目资源面积加载图像 [英] Load image from resources area of project in C#
本文介绍了从C#项目资源面积加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在储存在资源/ myimage.jpg我的项目的图像。我怎样才能动态地这个图像加载到Bitmap对象?
I have an image in my project stored at Resources/myimage.jpg. How can I dynamically load this image into Bitmap object?
推荐答案
您使用Windows窗体?如果您添加使用属性/资源UI图像,您可以访问从产生code的形象,所以你可以简单地做到这一点:
Are you using Windows Forms? If you've added the image using the Properties/Resources UI, you get access to the image from generated code, so you can simply do this:
var bmp = new Bitmap(WindowsFormsApplication1.Properties.Resources.myimage);
这篇关于从C#项目资源面积加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文