I have this code:
BitmapSource.Create(pixelWidth, pixelHeight,
dpiX, dpiY, image.Format, image.Palette,
_modifiedRgb, stride);
This is throwing an
ArgumentException – The buffer size is not enough.
Any ideas please?
That would mean that your
_modifiedRgbisn’t big enough.It needs to contain
Height * Stride * Format.BitsPerPixel/8bytes.