c#获取变量字符串中的资源名称,然后将其用作位图

时间:2017-03-29 14:17:19

标签: c# winforms variables resources

我怎样只想使用我的变量字符串,如资源文件的名称。

例如,使用资源看起来像:

 bool success = FindBitmap(Properties.Resources.waypoint1, bmpScreenshot, out location);

如你所见,我使用名为:waypoint1的资源。我需要做那样的事情:

 string wpt1 = "waypoint1";

但我不能那样简单:

bool success = FindBitmap(Properties.Resources.wpt1, bmpScreenshot, out location);

有人能给出一个简单的例子吗?我搜索了论坛,但无法找到解决方案。请耐心等待新手。谢谢!

编辑1

我的Findbitmap看起来像:

private bool FindBitmap(Bitmap bmpNeedle, Bitmap bmpHaystack, out Point location)

0 个答案:

没有答案