public static BitmapDecoder Create( Stream bitmapStream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption) { IPlatformBitmapDecoder platformImpl = PlatformInterface.Instance.CreateBitmapDecoder( bitmapStream, cacheOption); BitmapDecoder result; switch (platformImpl.ContainerFormat) { case BitmapContainerFormat.Jpeg: result = new JpegBitmapDecoder(platformImpl); break; case BitmapContainerFormat.Png: result = new PngBitmapDecoder(platformImpl); break; default: throw new NotSupportedException(); } if (cacheOption == BitmapCacheOption.OnLoad) { ReadOnlyCollection <BitmapFrame> loadFrames = result.Frames; } return(result); }
internal JpegBitmapDecoder(IPlatformBitmapDecoder platformImpl) : base(platformImpl) { }
internal PngBitmapDecoder(IPlatformBitmapDecoder platformImpl) : base(platformImpl) { }
internal BitmapDecoder(IPlatformBitmapDecoder platformImpl) { this.impl = platformImpl; }