How to get row and column from index?

前端 未结 4 626
南方客
南方客 2020-12-25 11:59

I\'m drawing a HUGE blank here.

Everything I\'ve found is about getting an index from a given row and column, but how do I get a row and a column from an in

4条回答
  •  醉梦人生
    2020-12-25 12:27

    Paxdiablo's answer is the right one. If someone needs the reverse process to get index from row and column:

    index = (row * width) + column
    

提交回复
热议问题