I have an image source behind IImageProvider interface, and I'm trying to access its pixels.
There is a method inside IImageProvider: imageProvider.GetBitmapAsync(bitmapToFill)
How can I access individual pixels of the source behind IImageProvider?
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);
}
and so on
imageSource is your IImageProvider, I tested it with BufferImageSource.