public void drawText (String text, float x, float y, Paint paint)
Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted based on the Align setting in the paint.
-
Parameters:
- text The text to be drawn
- x The x-coordinate of the origin of the text being drawn
- y The y-coordinate of the origin of the text being drawn
- paint The paint used for the text (e.g. color, size, style)
这个origin就是文字baseline基线的坐标。
public void drawBitmap(Bitmap btmap, float left, float top, Paint paint)
left The position of the left side of the bitmap being drawn
top The position of the top side of the bitmap being drawn
被绘制的图片的左边的位置,被绘制的图片的上边的位置.
本文详细介绍了在Canvas中使用drawText()和drawBitmap()方法进行绘图的操作。重点讨论了drawText()的baseline基线概念,并解释了drawBitmap()方法中left和top参数的作用,它们分别表示图片左边缘和顶部的绘制位置。
10万+

被折叠的 条评论
为什么被折叠?



