qq_39904887 2022-08-25 16:13 采纳率: 0%
浏览 96
已结题

怎么通过unity读取外部exe文件的图标

怎么通过unity读取外部exe文件的图标,用System.Drawing.Icon不可以

img

  • 写回答

4条回答 默认 最新

  • 石岩Maple 2022-08-25 16:35
    关注
    获得1.10元问题酬金
    
          [DllImport("shell32.DLL", EntryPoint = "ExtractAssociatedIcon")]
            private static extern int ExtractAssociatedIconA(int hInst, string lpIconPath, ref int lpiIcon); //声明函数
            static System.IntPtr thisHandle;
            public Image GetIcon(string path)
            {
                int RefInt = 0;
                thisHandle = new IntPtr(ExtractAssociatedIconA(0, path, ref RefInt));
                Image image = System.Drawing.Icon.FromHandle(thisHandle).ToBitmap();
                return image;
            }
    
    评论

报告相同问题?

问题事件

  • 系统已结题 9月2日
  • 修改了问题 8月25日
  • 创建了问题 8月25日

悬赏问题

  • ¥15 有什么好的直流步进减速电机42的厂家推荐,保持力矩达到0.3N.M
  • ¥15 IBS个体遗传距离计算
  • ¥15 一道蓝桥杯的题,请问我错在哪里
  • ¥15 关于#android问题,xposed模块找不到so
  • ¥15 UE5.4.2创建C++项目成功,但是编译失败
  • ¥15 华为手机备份nas,airdisk,遇到的空间不足问题。求个详细的解决方案。
  • ¥20 Cknife无法使用
  • ¥15 这个结构体为什么会出错呢?
  • ¥15 ROH绘图及近交系数的计算
  • ¥15 手动下载基因拼接数据库的渠道