我怎样才能提取在.NET中的图标文件中的特定图像? [英] How can I extract a specific Image from an Icon file in .NET?

查看:159
本文介绍了我怎样才能提取在.NET中的图标文件中的特定图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图标文件(* .ICO)可以包含多个图像在不同的颜色深度的不同尺寸和

Icon files (*.ico) may contain multiple images at different sizes and of different colour depths.

我怎样才能获得从为System.Drawing.Image 对象 .ICO 文件?

How can I obtain a System.Drawing.Image object from a .ico file?

一个选项是 Image.FromFile(...),但对多个图像图标文件有没有办法来指定图像的大小和颜色深度要返回的。

One option is Image.FromFile(...), but for icon files with multiple images there is no way to specify which image size and colour depth to return.

理想的解决方案将使用唯一的管理code,但我很高兴听到互操作调用Win32函数为好。

Ideally the solution would use only managed code, but I'm happy to hear about interop calls to Win32 functions as well.

推荐答案

简单的回答您的所有问题:的 IconLib

Simple answer to all your questions: IconLib

这篇关于我怎样才能提取在.NET中的图标文件中的特定图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆