这是什么canvas.translate办? [英] What does canvas.translate do?

查看:223
本文介绍了这是什么canvas.translate办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是实施例可以在这里<一发现href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html">compass.java. <一href="http://developer.android.com/reference/android/graphics/Canvas.html#translate%28float,%20float%29">Api这里

An example can be found here compass.java. Api here

推荐答案

翻译 - 基本上做什么它说。只用X,Y翻译画布。如果你想得出两个对象和一个只是翻译其他如X2 = X1 + 50的每个点。你不必让所有的计算再次为第二个对象,但你可以转换画布绘制再次同一个对象。我希望这个例如会帮助你。

Translate - Basically do what it says. Just translate the canvas using x,y. If you want to draw two objects and the one is just translation of the other e.g x2 = x1 + 50 for each point . You don't have to make all your calculations again for the second object but you can just translate the canvas and draw again the same object. I hope this example will help you.

这篇关于这是什么canvas.translate办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆