Android image rendering (VII) cliprect local drawing / cutting original drawing summary

Miscellaneous language: after reading a lot of programs, apes have the habit of blogging. It seems that I have to practice. No matter whether I write well or not, I can write if I learn something.

Content commentary: I started to learn game map making these days. Today, I'd like to summarize the use of the cliprect () interface of canvas.

1) Select the area to draw (refresh) on the canvas, such as the area with (x, y) as the starting coordinate, width W and height h in the figure

2) Select the picture to be drawn. It does not have to be just wide and high (W, H). The large picture needs to be cut (draw the green area in this example)

3) Draw the picture onto the canvas so that the green area coincides with the white square

4) Final rendering

Code explanation:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>