The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory.
之前还以为WritePixels(Int32Rect sourceRect, Array pixels, int stride, int offset)中的stride是传进去数组pixels的长度,结果出来的图像像雪花一样,还经常报AccessViolationException,后来看了msdn的一段关于图像处理的文字,还有就是上面的示例图,明白了一些,传进去这个2维数组的宽度值,但还是不行!
在不断的调整stride参数的值后才发现,传进去2维数组宽度的4倍值出来的图像才最完整,这才醒悟过来这个stride是指一行数据的字节数,唉,看书太不仔细了。