Travel through pixels in BMP

后端 未结 7 1064
梦谈多话
梦谈多话 2020-11-30 02:32

\"enter

Hi i have a bmp loaded to a BMP object and im requir

相关标签:
7条回答
  • 2020-11-30 03:11

    if you want to traverse it right, left, right, ... in one loop, this would do it:

    for (int i = 0 ; i < bmp.Height * bmp.Width; ++i) {
        int row = i / bmp.Height;
        int col = i % bmp.Width;
        if (row%2 != 0) col = bmp.Width - col-1;
        var pixel = bmp.GetPixel(col, row);
    }
    
    0 讨论(0)
提交回复
热议问题