`drawCircle()`半径参数单位?

时间:2015-11-21 23:26:58

标签: android android-canvas

Canvas.drawCircle()方法中radius参数的单位是什么?

是像素吗?还是蘸?

http://developer.android.com/reference/android/graphics/Canvas.html#drawCircle(float,float,float,android.graphics.Paint)

我试着查看源代码以查看是否可以获得任何想法,但该方法只是一个包装器,并且文档没有指定任何内容。

1 个答案:

答案 0 :(得分:3)

正如official docs中所述:

bbb

根据定义,位图使用像素,而不使用其他任何内容。

因此,所有When you're writing an application in which you would like to perform specialized drawing and/or control the animation of graphics, you should do so by drawing through a Canvas. A Canvas works for you as a pretense, or interface, to the actual surface upon which your graphics will be drawn — it holds all of your "draw" calls. Via the Canvas, your drawing is actually performed upon an underlying Bitmap, which is placed into the window.方法都在 px