DroidExplorer.Core.UI.SystemImageList.Icon C# (CSharp) Method

Icon() public method

Returns a GDI+ copy of the icon from the ImageList at the specified index.
public Icon ( int index ) : Icon
index int The index to get the icon for
return System.Drawing.Icon
		public Icon Icon ( int index ) {
			Icon icon = null;

			IntPtr hIcon = IntPtr.Zero;
			if ( iImageList == null ) {
				hIcon = ImageList_GetIcon (
					hIml,
					index,
					(int)ImageListDrawItemConstants.ILD_TRANSPARENT );

			} else {
				iImageList.GetIcon (
					index,
					(int)ImageListDrawItemConstants.ILD_TRANSPARENT,
					ref hIcon );
			}

			if ( hIcon != IntPtr.Zero ) {
				icon = System.Drawing.Icon.FromHandle ( hIcon );
			}
			return icon;
		}

Usage Example

Exemplo n.º 1
0
 private Image GetSystemBitmap(SystemImageList sysImgList, int index)
 {
     System.Drawing.Icon ico = sysImgList.Icon(index);
     if (ico != null)
     {
         return(ico.ToBitmap( ));
     }
     else
     {
         return(null);
     }
 }
All Usage Examples Of DroidExplorer.Core.UI.SystemImageList::Icon