public static BitmapDecoder DecoderByMimeType( ID3.Images.MimeType mimeType, Stream inStream) { if (mimeType == ID3.Images.MimeType.Png) { return(new PngBitmapDecoder( inStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)); } else if (mimeType == ID3.Images.MimeType.Jpg) { return(new JpegBitmapDecoder( inStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)); } else if (mimeType == ID3.Images.MimeType.Bmp) { return(new BmpBitmapDecoder( inStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)); } else { return(null); } }
public static string BrowseForSaveByMimeType( ID3.Images.MimeType mimeType) { switch (mimeType) { case ID3.Images.MimeType.Jpg: return(CoreControls.FileBrowserUtils.BrowseSaveJpg()); case ID3.Images.MimeType.Png: return(CoreControls.FileBrowserUtils.BrowseSavePng()); } throw new Exception("Unknown mime type"); }