如何动态读取resources里的图片?

来源:百度知道 编辑:UC知道 时间:2024/06/16 02:06:25
properties.resources.图片名好像只能读取特定的图片啊?我要求双击LISTBOX里某一行的话就调用resources里和那行关联的图片怎么做。。。
playerphoto.Image = Image.FromFile(Application.StartupPath + "\\特雷西-麦克格雷迪.bmp");
这样写可以
playerphoto.Image = Image.FromFile(Application.StartupPath + "\\" + playerinfo.selecteditem + ".bmp");
这样写就错(playerinfo.selecteditem这个和"特雷西-麦克格雷迪"一样)
为什么啊???

老大,
playerphoto.Image = Image.FromFile(Application.StartupPath + "\\" + playerinfo.selecteditem + ".bmp");
这个是什么?selecteditem 是一个集合对吧?

你要给bmp的名字呀?