public RgbaBitmapSource(byte[] rgbaBuffer, int pixelWidth) { this.rgbaBuffer = rgbaBuffer; this.pixelWidth = pixelWidth; this.pixelHeight = rgbaBuffer.Length / (4 * pixelWidth); }