【问题标题】:How are the pixels placed in an int[] array of pixels when getting pixels from a Android Bitmap?从 Android 位图获取像素时,如何将像素放置在 int[] 像素数组中?
【发布时间】:2014-07-19 02:10:10
【问题描述】:

我真的需要知道一些关于 bitmap.getPixels(...) 的细节,文档没有说。我想知道 int[] 数组中的像素是如何显示的。是逐行还是逐列?

更具体一点:

imagine image: [0,0][0,1][0,2][0,3]
               [1,0][1,1][1,2][1,3]
array looks like this?: [0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3]
or it looks like this?: [0,0],[1,0],[0,1],[1,1],[0,2],[1,2]...

谢谢!

【问题讨论】:

    标签: android arrays image bitmap


    【解决方案1】:

    getPixels函数的第三个参数(int stride),需要在函数中说明每一行有多少像素。所以函数知道 X 像素后必须跳过新行。

    Here你可以找到文档!

    【讨论】:

    • 嗯..我必须承认我没有完全理解“在行之间跳过”的实际含义。你说清楚了!谢谢;)
    猜你喜欢
    • 1970-01-01
    • 2011-09-25
    • 2014-08-05
    • 2011-05-08
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多