Canvas.drawCircle()
方法中半径参数的单位是多少?
是像素吗?还是蘸?
http://developer.android.com/reference/android/graphics/Canvas.html#drawCircle(float,float,浮动,android.graphics.Paint)
我试着查看源代码,看看是否能得到任何想法,但该方法只是一个包装器,文档中没有指定任何内容。
如官方文档中所述:
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.
根据定义,位图使用像素,而不使用其他像素作为其单位。
因此,所有的drawXYZ()
方法都在px中。