public Event EnqueueCopyImageToBuffer(Image sourceImage, Buffer destinationBuffer, BufferCoordinates sourceOrigin, BufferSize region, long destinationOffset, params Event[] eventWaitList) { EventSafeHandle[] eventHandles = null; if (eventWaitList != null) { eventHandles = Array.ConvertAll(eventWaitList, @event => @event.Handle); } EventSafeHandle handle = UnsafeNativeMethods.EnqueueCopyImageToBuffer(Handle, sourceImage.Handle, destinationBuffer.Handle, ref sourceOrigin, ref region, (IntPtr)destinationOffset, eventHandles); return(new Event(handle)); }