Square transition

How can I break up an image into like a 10x10 square grid using bitmap data and a matrix? I understand the concept of doing it, but my math is not very good