I think that a function NativePtr.writecan only be used to write one value at a time, so if you want to copy an array, you have to use a loop for.
A simpler option would be to use a method Marshal.Copy( see MSDN ), which takes the original array (there are overloads for arrays containing elements of various types) and intptras the destination.
Something like this should work:
let imageData = [| ... |]
writeableBitmap.Lock()
let buffer = writeableBitmap.BackBuffer
Marshal.Copy(imageData, 0, buffer, imageData.Length)
source
share