在C ++ CLI中显示本地资源的图标

时间:2016-08-11 12:52:13

标签: windows forms resources icons c++-cli

我想显示我的一个图标(.ico文件),它们位于.resx文件中。 This这种方式适用于图像,但我无法弄清楚如何使用图标。这样它就可以显示系统图标:

    System::Drawing::Icon^ officialicon = gcnew System::Drawing::Icon(SystemIcons::Exclamation, 48,48);
    IconPictureBox->Image = officialicon->ToBitmap();

但我不能让它像这样工作:

    ResourceManager^ rm = gcnew ResourceManager("Control_Panel.Resource", GetType()->Assembly);
    System::Drawing::Icon^ officialicon = gcnew System::Drawing::Icon(rm->GetObject(L"MyIcon"), 48,48);
    IconPictureBox->Image = officialicon->ToBitmap();

我需要从System::ObjectSystem::Drawing::Icon进行某种演员表吗?

1 个答案:

答案 0 :(得分:0)

好的,我想通了,我需要把它投到<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>System::Drawing::Icon