Have you tried this?
var bitmap = await imageSource.GetBitmapAsync(null, OutputOption.PreserveAspectRatio);
var pixels = bitmap.Buffers[0];
for (uint i = 0; i < pixels.Buffer.Length; i++)
{
var val = pixels.Buffer.GetByte(i);
}
- i = R ... [0]
- i+1 = G ... [1]
- i+2 = B ... [2]
- i+3 = A ... [3]
and so on
imageSource is your IImageProvider, I tested it with BufferImageSource.