drawBitmap() and setPixels(): what's the stride?

后端 未结 4 1728
轮回少年
轮回少年 2021-02-12 13:09

Could please somebody explain me (ASCII is really welcome) what the stride argument stands for in Canvas.drawBitmap() and in Bitmap.setPixels()/getPixels()? I under

4条回答
  •  一个人的身影
    2021-02-12 14:09

    In most cases the stride is the same as the width. The stride is useful if you are trying to copy/draw a sub-region of a Bitmap. For instance, if you have a 100x100 bitmap and you want to draw the 50x50 top-right corner, you can use a width of 50px and a stride of 100px.

提交回复
热议问题