I finally found an alternative to using WriteableBitmap to export to a byte array.
I started using this function to do that:
Public Async Function ImageFileToByteArray(file As StorageFile) As Task(Of [Byte]())
Dim stream As IRandomAccessStream = Await file.OpenAsync(Windows.Storage.FileAccessMode.Read)
Dim decoder As BitmapDecoder = Await BitmapDecoder.CreateAsync(stream)
Dim pixelData As PixelDataProvider = Await decoder.GetPixelDataAsync()
Return pixelData.DetachPixelData()
End Function
This proved to be highly enlightening as I was able to look at the pixel format of the decoder. It told me that the file I was reading was in BGRA8 format. Armed with this knowledge, I rewrote my blue-red swapper and, voila: success!
So my final code was:
Dim arr As Byte() = Await ImageFileToByteArray(imgfile)
Dim newarr(arr.Length - 1) As Byte
For i As Integer = 0 To arr.Length - 1 Step 4
newarr(i) = arr(i + 2)
newarr(i + 1) = arr(i + 1)
newarr(i + 2) = arr(i)
newarr(i + 3) = arr(i + 3)
Next
VidGen.AppendNewFrame(newarr)
Thank you, Bill for your help! You set me on the right track!