c# - Bitmap Stride 和 4 bytes 的关系?

标签 c# image image-processing bitmap

这句话是什么意思:

The Stride property, holds the width of one row in bytes. The size of a row however may not be an exact multiple of the pixel size because for efficiency, the system ensures that the data is packed into rows that begin on a four byte boundary and are padded out to a multiple of four bytes.

最佳答案

这意味着如果您的图像宽度为 17 像素并且颜色为 3 个字节,则您将获得 51 个字节。因此,您的图像宽度(以字节为单位)为 51 字节,那么步长为 52 字节,这是图像宽度(以字节为单位)四舍五入到下一个 4 字节边界。

关于c# - Bitmap Stride 和 4 bytes 的关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5735997/

相关文章:

c# - Docker Copy 使用 ASP.net Core 失败

c# - 我如何检查数据库的属性值C#

c# - 以编程方式将新用户插入到 aspnet 成员资格架构中

database - 存储大图像

c# - 如何在silverlight中设置图像的位置

php - 我的 Imagick 代码似乎从未调整大小,但仍然产生清晰的图像

algorithm - 如何用实数坐标计算像素的颜色

c# - 在 C# 中附加到鼠标的工具提示

python - 检测目标图像上的弹孔

javascript - 文件对象到具有正确文件名而不是 src ="blob..."的图像