Why does BitmapSource.Create throw an ArgumentException?
Your stride is incorrect. Stride is the number of bytes allocated for one scanline of the bitmap. Thus, use the following: int stride = ((RenderWidth * 32 + 31) & ~31) / 8; and replace the last parameter (currently 0) with stride as defined above. Here is an explanation for the mysterious stride formula: Fact: … Read more