Пример #1
0
        public static DataEntry[][] CompareInfos(this IWICComponentInfo left, IWICComponentInfo right)
        {
            List <DataEntry[]> res = new List <DataEntry[]>();

            Check(left.GetAuthor, right.GetAuthor, res);
            Check(left.GetCLSID, right.GetCLSID, res);
            Check <WICComponentType>(left.GetComponentType, right.GetComponentType, res);
            Check(left.GetFriendlyName, right.GetFriendlyName, res);
            Check <WICComponentSigning>(left.GetSigningStatus, right.GetSigningStatus, res);
            Check(left.GetSpecVersion, right.GetSpecVersion, res);
            Check(left.GetVendorGUID, right.GetVendorGUID, res);
            Check(left.GetVersion, right.GetVersion, res);

            return(res.ToArray());
        }
Пример #2
0
        private static IEnumerable <DataEntry[]> CompareInfos(this IWICComponentInfo left, IWICComponentInfo right)
        {
            var res = new List <DataEntry[]>();

            Check(left.GetAuthor, right.GetAuthor, res);
            Check(left.GetCLSID, right.GetCLSID, res);
            Check(left.GetComponentType, right.GetComponentType, res);
            Check(left.GetFriendlyName, right.GetFriendlyName, res);
            Check(left.GetSigningStatus, right.GetSigningStatus, res);
            Check(left.GetSpecVersion, right.GetSpecVersion, res);
            Check(left.GetVendorGUID, right.GetVendorGUID, res);
            Check(left.GetVersion, right.GetVersion, res);

            return(res.ToArray());
        }
Пример #3
0
        public static DataEntry[][] CompareInfos(this IWICBitmapCodecInfo left, IWICBitmapCodecInfo right)
        {
            IWICComponentInfo l = left as IWICComponentInfo;

            var res = new List <DataEntry[]>(l.CompareInfos(right));

            Check <bool>(left.DoesSupportAnimation, right.DoesSupportAnimation, res);
            Check <bool>(left.DoesSupportChromakey, right.DoesSupportChromakey, res);
            Check <bool>(left.DoesSupportLossless, right.DoesSupportLossless, res);
            Check <bool>(left.DoesSupportMultiframe, right.DoesSupportMultiframe, res);
            Check(left.GetColorManagementVersion, right.GetColorManagementVersion, res);
            Check(left.GetContainerFormat, right.GetContainerFormat, res);
            Check(left.GetDeviceManufacturer, right.GetDeviceManufacturer, res);

            CheckCommaSeparated(left.GetDeviceModels, right.GetDeviceModels, res);
            CheckCommaSeparated(left.GetMimeTypes, right.GetMimeTypes, res);
            CheckCommaSeparated(left.GetFileExtensions, right.GetFileExtensions, res);

            return(res.ToArray());
        }
Пример #4
0
        private static IEnumerable <IWICComponentInfo> GetComponentInfos(WICComponentType type)
        {
            IWICImagingFactory factory = (IWICImagingFactory) new WICImagingFactoryCoClass();
            IEnumUnknown       eu      = null;

            object[] o = new object[1];

            try
            {
                eu = factory.CreateComponentEnumerator(type, WICComponentEnumerateOptions.WICComponentEnumerateDefault);

                int hr = 0;
                while (hr == 0)
                {
                    uint fetched = 0;
                    hr = eu.Next(1, o, ref fetched);
                    Marshal.ThrowExceptionForHR(hr);
                    if (fetched == 1)
                    {
                        IWICComponentInfo ci = (IWICComponentInfo)o[0];
                        try
                        {
                            yield return(ci);
                        }
                        finally
                        {
                            Marshal.ReleaseComObject(ci);
                        }
                    }
                }
            }
            finally
            {
                if (eu != null)
                {
                    Marshal.ReleaseComObject(eu);
                }
                Marshal.ReleaseComObject(factory);
            }
        }
Пример #5
0
        public static IEnumerable <IWICComponentInfo> GetComponentInfos(WICComponentType type)
        {
            IWICImagingFactory factory = (IWICImagingFactory) new WICImagingFactory();
            IEnumUnknown       eu      = null;

            object[] o = new object[1];

            try
            {
                eu = factory.CreateComponentEnumerator(type, WICComponentEnumerateOptions.WICComponentEnumerateRefresh | WICComponentEnumerateOptions.WICComponentEnumerateDisabled);

                int hr = 0;
                while (hr == 0)
                {
                    uint fetched = 0;
                    hr = eu.Next(1, o, ref fetched);
                    Marshal.ThrowExceptionForHR(hr);
                    if (fetched == 1)
                    {
                        IWICComponentInfo ci = (IWICComponentInfo)o[0];
                        try
                        {
                            yield return(ci);
                        }
                        finally
                        {
                            ci.ReleaseComObject();
                        }
                    }
                }
            }
            finally
            {
                factory.ReleaseComObject();
                eu.ReleaseComObject();
            }
        }
Пример #6
0
 public static string GetAuthor(this IWICComponentInfo componentInfo)
 {
     return(FetchIntoBufferHelper.FetchString(componentInfo.GetAuthor));
 }
Пример #7
0
 public static string GetSpecVersion(this IWICComponentInfo componentInfo)
 {
     return(FetchIntoBufferHelper.FetchString(componentInfo.GetSpecVersion));
 }
Пример #8
0
 public static string GetFriendlyName(this IWICComponentInfo componentInfo)
 {
     return(FetchIntoBufferHelper.FetchString(componentInfo.GetFriendlyName));
 }
Пример #9
0
        public static string GetAuthor(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetAuthor;

            return(fetcher.FetchString());
        }
Пример #10
0
        public static string GetSpecVersion(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetSpecVersion;

            return(fetcher.FetchString());
        }
Пример #11
0
        public static string GetFriendlyName(this IWICComponentInfo componentInfo)
        {
            FetchIntoBuffer <char> fetcher = componentInfo.GetFriendlyName;

            return(fetcher.FetchString());
        }