コード例 #1
0
 public CGImage?CreateImage(int index, CGImageOptions options)
 {
     using (var dict = options?.ToDictionary()) {
         var ret = CGImageSourceCreateImageAtIndex(Handle, index, dict.GetHandle());
         return(ret == IntPtr.Zero ? null : new CGImage(ret, true));
     }
 }
コード例 #2
0
 public NSDictionary CopyProperties(CGImageOptions options, int imageIndex)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     return(CopyProperties(options.ToDictionary(), imageIndex));
 }
コード例 #3
0
 public NSDictionary?CopyProperties(CGImageOptions options, int imageIndex)
 {
     if (options is null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     using var dict = options.ToDictionary();
     return(CopyProperties(dict, imageIndex));
 }
コード例 #4
0
        public static CGImageSource FromData(NSData data, CGImageOptions options)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            using (var dict = options == null ? null : options.ToDictionary()) {
                var result = CGImageSourceCreateWithData(data.Handle, dict == null ? IntPtr.Zero : dict.Handle);
                return(result == IntPtr.Zero ? null : new CGImageSource(result, true));
            }
        }
コード例 #5
0
        public static CGImageSource FromDataProvider(CGDataProvider provider, CGImageOptions options)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            using (var dict = options == null ? null : options.ToDictionary()) {
                var result = CGImageSourceCreateWithDataProvider(provider.Handle, dict == null ? IntPtr.Zero : dict.Handle);
                return(result == IntPtr.Zero ? null : new CGImageSource(result, true));
            }
        }
コード例 #6
0
        public static CGImageSource FromUrl(NSUrl url, CGImageOptions options)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            using (var dict = options == null ? null : options.ToDictionary()) {
                var result = CGImageSourceCreateWithURL(url.Handle, dict == null ? IntPtr.Zero : dict.Handle);
                return(result == IntPtr.Zero ? null : new CGImageSource(result, true));
            }
        }
コード例 #7
0
        public static CGImageSource?FromData(NSData data, CGImageOptions?options)
        {
            if (data is null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            using (var dict = options?.ToDictionary()) {
                var result = CGImageSourceCreateWithData(data.Handle, dict.GetHandle());
                return(result == IntPtr.Zero ? null : new CGImageSource(result, true));
            }
        }
コード例 #8
0
        public static CGImageSource?FromUrl(NSUrl url, CGImageOptions?options)
        {
            if (url is null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            using (var dict = options?.ToDictionary()) {
                var result = CGImageSourceCreateWithURL(url.Handle, dict.GetHandle());
                return(result == IntPtr.Zero ? null : new CGImageSource(result, true));
            }
        }
コード例 #9
0
        public CGImageMetadata CopyMetadata(nint index, CGImageOptions options)
        {
            NSDictionary o = null;

            if (options != null)
            {
                o = options.ToDictionary();
            }
            var result = CopyMetadata(index, o);

            if (options != null)
            {
                o.Dispose();
            }
            return(result);
        }
コード例 #10
0
 public static CGImageSource CreateIncremental(CGImageOptions options)
 {
     using (var dict = options == null ? null : options.ToDictionary())
         return(new CGImageSource(CGImageSourceCreateIncremental(dict == null ? IntPtr.Zero : dict.Handle), true));
 }
コード例 #11
0
 public CoreGraphics.CGImageProperties GetProperties(int index, CGImageOptions options = null)
 {
     return(new CoreGraphics.CGImageProperties(CopyProperties(options == null ? null : options.ToDictionary(), index)));
 }
コード例 #12
0
 public static CGImageSource CreateIncremental(CGImageOptions?options)
 {
     using (var dict = options?.ToDictionary())
         return(new CGImageSource(CGImageSourceCreateIncremental(dict.GetHandle()), true));
 }
コード例 #13
0
 public CoreGraphics.CGImageProperties GetProperties(int index, CGImageOptions?options = null)
 {
     using var dict = options?.ToDictionary();
     return(new CoreGraphics.CGImageProperties(CopyProperties(dict, index)));
 }
コード例 #14
0
 public CGImageMetadata?CopyMetadata(nint index, CGImageOptions?options)
 {
     using var o = options?.ToDictionary();
     return(CopyMetadata(index, o));
 }