public Event EnqueueCopyBufferToImage(Buffer sourceBuffer, Image destinationImage, long sourceOffset, BufferCoordinates destinationOrigin, BufferSize region, params Event[] eventWaitList) { EventSafeHandle[] eventHandles = null; if (eventWaitList != null) { eventHandles = Array.ConvertAll(eventWaitList, @event => @event.Handle); } EventSafeHandle handle = UnsafeNativeMethods.EnqueueCopyBufferToImage(Handle, sourceBuffer.Handle, destinationImage.Handle, (IntPtr)sourceOffset, ref destinationOrigin, ref region, eventHandles); return(new Event(handle)); }