图像处理中的步幅和宽度

时间:2014-05-06 10:01:00

标签: c# image-processing pixels bitmapimage bitmapdata

我有一个需要阅读的1bpp图像。

我遇到了以下逻辑。但我不确定它想做什么。

     int value = (imagebmd.Width + 15) >> 3;       
     byte* row = (byte*)imagebmd.Scan0;

我不明白列和行变量中存储的值。

1 个答案:

答案 0 :(得分:0)

int columns = (imagebmd.Width + 7) >> 3;

这是字节图像行的长度。它相当于四舍五入

columns = Ceil(bitwidth / 8)

行是指向图像数据起始地址的指针。