Example #1
0
        public void AddImage(CGImageSource source, int index, NSDictionary?properties)
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            CGImageDestinationAddImageFromSource(Handle, source.Handle, index, properties.GetHandle());
        }
        public void AddImage(CGImageSource source, int index, NSDictionary properties)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            CGImageDestinationAddImageFromSource(handle, source.Handle, index, properties == null ? IntPtr.Zero : properties.Handle);
        }
Example #3
0
        public void AddImage(CGImageSource source, int index, CGImageDestinationOptions?options = null)
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            using var dict = options?.ToDictionary();
            CGImageDestinationAddImageFromSource(Handle, source.Handle, index, dict.GetHandle());
        }
Example #4
0
        public bool CopyImageSource(CGImageSource image, NSDictionary?options, out NSError?error)
        {
            if (image is null)
            {
                throw new ArgumentNullException(nameof(image));
            }
            var result = CGImageDestinationCopyImageSource(Handle, image.Handle, options.GetHandle(), out var err);

            error = Runtime.GetNSObject <NSError> (err);
            return(result);
        }
        public bool CopyImageSource(CGImageSource image, NSDictionary options, out NSError error)
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }
            IntPtr err;

            IntPtr o      = options == null ? IntPtr.Zero : options.Handle;
            bool   result = CGImageDestinationCopyImageSource(handle, image.Handle, o, out err);

            error = err == IntPtr.Zero ? null : new NSError(err);
            return(result);
        }
        public void AddImage(CGImageSource source, int index, CGImageDestinationOptions options = null)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            var dict = options == null ? null : options.ToDictionary();

            CGImageDestinationAddImageFromSource(handle, source.Handle, index, dict == null ? IntPtr.Zero : dict.Handle);
            if (dict != null)
            {
                dict.Dispose();
            }
        }
Example #7
0
        public bool CopyImageSource(CGImageSource image, CGCopyImageSourceOptions options, out NSError error)
        {
            NSDictionary o = null;

            if (options != null)
            {
                o = options.ToDictionary();
            }
            try {
                return(CopyImageSource(image, o, out error));
            }
            finally {
                if (options != null)
                {
                    o.Dispose();
                }
            }
        }
 public bool CopyImageSource(CGImageSource image, CGCopyImageSourceOptions options, out NSError error)
Example #9
0
 public bool CopyImageSource(CGImageSource image, CGCopyImageSourceOptions?options, out NSError?error)
 {
     using var o = options?.ToDictionary();
     return(CopyImageSource(image, o, out error));
 }