示例#1
0
 public extern IEnumUnknown CreateComponentEnumerator([In] WICComponentType componentTypes, [In] WICComponentEnumerateOptions options);
示例#2
0
        public static IComObject <IEnumUnknown> CreateComponentEnumerator(this IWICImagingFactory factory, WICComponentType type = WICComponentType.WICAllComponents, WICComponentEnumerateOptions options = WICComponentEnumerateOptions.WICComponentEnumerateDefault)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            factory.CreateComponentEnumerator(type, options, out var value).ThrowOnError();
            return(new ComObject <IEnumUnknown>(value));
        }
示例#3
0
        public static IEnumerable <IComObject <IWICComponentInfo> > EnumerateComponents(this IWICImagingFactory factory, WICComponentType type, WICComponentEnumerateOptions options)
        {
            using (var enumerator = factory.CreateComponentEnumerator(type, options))
            {
                do
                {
                    var o       = new object[1];
                    var fetched = 0;
                    enumerator.Object.Next(1, o, ref fetched);
                    if (fetched != 1)
                    {
                        break;
                    }

                    if (o[0] is IWICComponentInfo info)
                    {
                        yield return(new ComObject <IWICComponentInfo>(info));
                    }
                }while (true);
            }
        }
示例#4
0
 public static IComObject <IEnumUnknown> CreateComponentEnumerator(this IComObject <IWICImagingFactory> factory, WICComponentType type = WICComponentType.WICAllComponents, WICComponentEnumerateOptions options = WICComponentEnumerateOptions.WICComponentEnumerateDefault) => CreateComponentEnumerator(factory?.Object, type, options);