internal static D2DBitmap LoadBitmapFromFile(
            RenderTarget renderTarget,
            ImagingFactory wicFactory,
            string fileName)
        {

            BitmapDecoder decoder = wicFactory.CreateDecoderFromFileName(fileName, DesiredAccess.Read, DecodeMetadataCacheOption.OnLoad);
            return CreateBitmapFromDecoder(renderTarget, wicFactory, decoder);
        }
예제 #2
0
        internal static D2DBitmap LoadBitmapFromFile(
            RenderTarget renderTarget,
            ImagingFactory wicFactory,
            string fileName)
        {
            BitmapDecoder decoder = wicFactory.CreateDecoderFromFileName(fileName, DesiredAccess.Read, DecodeMetadataCacheOption.OnLoad);

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

            BitmapDecoder bitmapDecoder =
                factory.CreateDecoderFromFileName(
                    filePath,
                    DesiredAccess.Read,
                    DecodeMetadataCacheOption.OnDemand);

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