CSharpImageLibrary.WIC_Codecs.AttemptUsingWindowsCodecs C# (CSharp) Метод

AttemptUsingWindowsCodecs() приватный статический Метод

Attempts to read image using WIC Codecs. Returns null if unable to.
private static AttemptUsingWindowsCodecs ( Stream stream, int decodeWidth, int decodeHeight ) : BitmapImage
stream Stream Stream containing entire file. NOT raw pixels.
decodeWidth int Width to decode to. Aspect unchanged if decodeHeight = 0.
decodeHeight int Height to decode to. Aspect unchanged if decodeWidth = 0.
Результат System.Windows.Media.Imaging.BitmapImage
        private static BitmapImage AttemptUsingWindowsCodecs(Stream stream, int decodeWidth, int decodeHeight)
        {
            BitmapImage img = null;
            try
            {
                img = UsefulThings.WPF.Images.CreateWPFBitmap(stream, decodeWidth, decodeHeight);
            }
            catch (FileFormatException fileformatexception)
            {
                Debug.WriteLine(fileformatexception);
            }
            catch (NotSupportedException notsupportedexception)
            {
                Debug.WriteLine(notsupportedexception);
            }

            img.Freeze();
            return img;
        }

Same methods

WIC_Codecs::AttemptUsingWindowsCodecs ( byte ImageFileData, int decodeWidth, int decodeHeight ) : BitmapImage
WIC_Codecs::AttemptUsingWindowsCodecs ( string imagePath, int decodeWidth, int decodeHeight ) : BitmapImage