Canvas - magician-f/Hyena GitHub Wiki
基础知识:绘制的坐标系,左上角的圆点是(0,0) 右下为正,左上为负
填充颜色
drawColor(@ColorInt int color)
画圆
drawCircle(float centerX, float centerY, float radius, Paint paint)
画椭圆
drawOval(float left, float top, float right, float bottom, Paint paint)
画矩形
drawRect(float left, float top, float right, float bottom, Paint paint)
画圆角矩形
drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint)
绘制文字
drawText(String text, float x, float y, Paint paint)
画自定义图形
drawPath(Path path, Paint paint)
画 Bitmap
drawBitmap(Bitmap bitmap, float left, float top, Paint paint)
drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)
drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)
drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)
画点
drawPoint(float x, float y, Paint paint)
画点(批量)
drawPoints(float[] pts, int offset, int count, Paint paint)
drawPoints(float[] pts, Paint paint)
画线
drawLine(float startX, float startY, float stopX, float stopY, Paint paint)
画线(批量)
drawLines(float[] pts, int offset, int count, Paint paint)
drawLines(float[] pts, Paint paint)