C# Class ResourceLib.Method.GetSystemIcon

提供从操作系统读取图标的方法
显示文件 Open project: magicdict/MongoCola

Public Properties

Property Type Description
IconImagelist System.Windows.Forms.ImageList
IconList int>.Dictionary
MainTreeImage System.Windows.Forms.ImageList
TabViewImage System.Windows.Forms.ImageList

Public Methods

Method Description
ByteArrayToImage ( byte byteArrayIn ) : Image
ConvertImgToIcon ( Image orgImg ) : Icon

Image转换为Icon

GetContentType ( string fileName ) : string

GetIconByFileName ( string fileName ) : Icon

依据文件名读取图标,若指定文件不存在,则返回空值。

GetIconByFileType ( string sFileExt ) : Icon

根据扩展名获得图标

GetIconByFileType ( string fileType, bool isLarge ) : Icon

给出文件扩展名(.*),返回相应图标 若不以"."开头则返回文件夹的图标。

GetIconIndexByFileName ( string fileName, bool isLarge ) : int

根据文件名获得图片数组下标

ImageToByteArray ( Image imageIn, ImageFormat format ) : byte[]
InitMainTreeImage ( ) : void

主树形控件图标数组初始化

InitTabViewImage ( ) : void

Private Methods

Method Description
DeleteObject ( IntPtr hObject ) : bool

Method Details

ByteArrayToImage() public static method

public static ByteArrayToImage ( byte byteArrayIn ) : Image
byteArrayIn byte
return Image

ConvertImgToIcon() public static method

Image转换为Icon
public static ConvertImgToIcon ( Image orgImg ) : Icon
orgImg Image
return System.Drawing.Icon

GetContentType() public static method

public static GetContentType ( string fileName ) : string
fileName string
return string

GetIconByFileName() public static method

依据文件名读取图标,若指定文件不存在,则返回空值。
public static GetIconByFileName ( string fileName ) : Icon
fileName string
return System.Drawing.Icon

GetIconByFileType() public static method

根据扩展名获得图标
public static GetIconByFileType ( string sFileExt ) : Icon
sFileExt string
return System.Drawing.Icon

GetIconByFileType() public static method

给出文件扩展名(.*),返回相应图标 若不以"."开头则返回文件夹的图标。
public static GetIconByFileType ( string fileType, bool isLarge ) : Icon
fileType string
isLarge bool
return System.Drawing.Icon

GetIconIndexByFileName() public static method

根据文件名获得图片数组下标
public static GetIconIndexByFileName ( string fileName, bool isLarge ) : int
fileName string
isLarge bool
return int

ImageToByteArray() public static method

public static ImageToByteArray ( Image imageIn, ImageFormat format ) : byte[]
imageIn Image
format System.Drawing.Imaging.ImageFormat
return byte[]

InitMainTreeImage() public static method

主树形控件图标数组初始化
public static InitMainTreeImage ( ) : void
return void

InitTabViewImage() public static method

public static InitTabViewImage ( ) : void
return void

Property Details

IconImagelist public_oe static_oe property

图片数组
public static ImageList,System.Windows.Forms IconImagelist
return System.Windows.Forms.ImageList

IconList public_oe static_oe property

扩展名和图片下标关联
public static Dictionary IconList
return int>.Dictionary

MainTreeImage public_oe static_oe property

主树形控件图标数组
public static ImageList,System.Windows.Forms MainTreeImage
return System.Windows.Forms.ImageList

TabViewImage public_oe static_oe property

主树形控件图标数组
public static ImageList,System.Windows.Forms TabViewImage
return System.Windows.Forms.ImageList