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(); } }
public void AddImage(CGImage image, CGImageDestinationOptions options = null) { if (image == null) { throw new ArgumentNullException("image"); } var dict = options == null ? null : options.ToDictionary(); CGImageDestinationAddImage(handle, image.Handle, dict == null ? IntPtr.Zero : dict.Handle); if (dict != null) { dict.Dispose(); } }
public void AddImageAndMetadata(CGImage image, CGImageMetadata meta, CGImageDestinationOptions options) { NSDictionary o = null; if (options != null) { o = options.ToDictionary(); } try { AddImageAndMetadata(image, meta, o); } finally { if (options != null) { o.Dispose(); } } }
public bool CopyImageSource(CGImageSource image, CGImageDestinationOptions options, out NSError error) #endif { NSDictionary o = null; if (options != null) { o = options.ToDictionary(); } try { return(CopyImageSource(image, o, out error)); } finally { if (options != null) { o.Dispose(); } } }
public static CGImageDestination FromUrl(NSUrl url, string typeIdentifier, int imageCount, CGImageDestinationOptions options) #endif { if (url == null) { throw new ArgumentNullException("url"); } if (typeIdentifier == null) { throw new ArgumentNullException("typeIdentifier"); } var typeId = NSString.CreateNative(typeIdentifier); IntPtr p = CGImageDestinationCreateWithURL(url.Handle, typeId, imageCount, IntPtr.Zero); NSString.ReleaseNative(typeId); var ret = p == IntPtr.Zero ? null : new CGImageDestination(p, true); return(ret); }
public static CGImageDestination FromData(NSData data, string typeIdentifier, int imageCount, CGImageDestinationOptions options) #endif { if (data == null) { throw new ArgumentNullException("data"); } if (typeIdentifier == null) { throw new ArgumentNullException("typeIdentifier"); } var dict = options == null ? null : options.ToDictionary(); var typeId = NSString.CreateNative(typeIdentifier); IntPtr p = CGImageDestinationCreateWithData(data.Handle, typeId, imageCount, dict == null ? IntPtr.Zero : dict.Handle); NSString.ReleaseNative(typeId); var ret = p == IntPtr.Zero ? null : new CGImageDestination(p, true); if (dict != null) { dict.Dispose(); } return(ret); }
// binding mistake -> NSMutableData, not NSData // naming mistake -> it's not From since it will write into (not read from) 'data' #if XAMCORE_2_0 public static CGImageDestination Create(NSMutableData data, string typeIdentifier, int imageCount, CGImageDestinationOptions options = null)