internal static D2DBitmap LoadBitmapFromStream(
     RenderTarget renderTarget,
     ImagingFactory wicFactory,
     Stream ioStream)
 {
     BitmapDecoder decoder = wicFactory.CreateDecoderFromStream(ioStream, DecodeMetadataCacheOption.OnLoad);
     return CreateBitmapFromDecoder(renderTarget, wicFactory, decoder);
 }
Exemple #2
0
        internal static D2DBitmap LoadBitmapFromStream(
            RenderTarget renderTarget,
            ImagingFactory wicFactory,
            Stream ioStream)
        {
            BitmapDecoder decoder = wicFactory.CreateDecoderFromStream(ioStream, DecodeMetadataCacheOption.OnLoad);

            return(CreateBitmapFromDecoder(renderTarget, wicFactory, decoder));
        }
        /// <summary>
        /// Creates a ShaderResourceView from a bitmap in a Stream. 
        /// </summary>
        /// <param name="device">The Direct3D device that will own the ShaderResourceView</param>
        /// <param name="stream">Any Windows Imaging Component decodable image</param>
        /// <returns>A ShaderResourceView object with the loaded texture.</returns>
        public static ShaderResourceView LoadTexture( D3DDevice device, Stream stream )
        {
            ImagingFactory factory = new ImagingFactory( );

            BitmapDecoder bitmapDecoder =
                factory.CreateDecoderFromStream(
                    stream,
                    DecodeMetadataCacheOptions.OnDemand );

            return LoadFromDecoder(device, factory, bitmapDecoder);
        }
Exemple #4
0
        /// <summary>
        /// Creates a ShaderResourceView from a bitmap in a Stream.
        /// </summary>
        /// <param name="device">The Direct3D device that will own the ShaderResourceView</param>
        /// <param name="stream">Any Windows Imaging Component decodable image</param>
        /// <returns>A ShaderResourceView object with the loaded texture.</returns>
        public static ShaderResourceView LoadTexture(D3DDevice device, Stream stream)
        {
            ImagingFactory factory = ImagingFactory.Create();

            BitmapDecoder bitmapDecoder =
                factory.CreateDecoderFromStream(
                    stream,
                    DecodeMetadataCacheOption.OnDemand);

            return(LoadFromDecoder(device, factory, bitmapDecoder));
        }