Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 internal JpegBitmapDecoder(IPlatformBitmapDecoder platformImpl)
     : base(platformImpl)
 {
 }
Ejemplo n.º 3
0
 internal PngBitmapDecoder(IPlatformBitmapDecoder platformImpl)
     : base(platformImpl)
 {
 }
Ejemplo n.º 4
0
 internal BitmapDecoder(IPlatformBitmapDecoder platformImpl)
 {
     this.impl = platformImpl;
 }
Ejemplo n.º 5
0
 internal BitmapDecoder(IPlatformBitmapDecoder platformImpl)
 {
     this.impl = platformImpl;
 }