public static IcnsImage GetImage(Stream stream) { IcnsElement[] icnsContents = ReadImage(stream); List <IcnsImage> result = IcnsDecoder.DecodeAllImages(icnsContents); if (result.Count <= 0) { throw new NotSupportedException("No icons in ICNS file"); } IcnsImage max = null; foreach (IcnsImage bitmap in result) { if (bitmap.Bitmap != null && (max == null || (bitmap.Bitmap.Width > bitmap.Bitmap.Height))) { max = bitmap; } } return(max); }
public static List <IcnsImage> GetImages(Stream stream) { IcnsElement[] icnsContents = ReadImage(stream); return(IcnsDecoder.DecodeAllImages(icnsContents)); }