Remove the corresponding resource from a resource based on a string ResourceManager.GetObject

ResourceManager.GetObject

The removed resources from the name

Need: I have 25 five-stroke pictures abcd ... y name is so constituted

Each image name only one name

clipboard

I think this picture taken by a string a

I think this picture taken by a string b b

I think this picture taken by a string c c

...

If to judge if the case was 26 if, but I just want to be judged by a

object obj = Properties.Resources.ResourceManager.GetObject("a");

//if (obj != null)

{

       pictureBox1.Image = (Bitmap)obj;

}

https://www.reddit.com/r/csharp/comments/4qefx8/how_to_load_an_image_from_resources_in_visual_c/

C # is a look at how to do

clipboard

Guess you like

Origin www.cnblogs.com/xe2011/p/11517205.html