Class SXShape


  • public class SXShape
    extends java.lang.Object
    蒙版
    • Constructor Summary

      Constructors 
      Constructor Description
      SXShape()
      创建一个 Shape
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void arcTo​(float x1, float y1, float x2, float y2, float radius)
      以上一个点为起点添加一条弧线
      void bezierTo​(float c1x, float c1y, float c2x, float c2y, float x, float y)
      从上一个点开始添加一条三次贝塞尔曲线
      void circle​(float cx, float cy, float r)
      添加一个圆
      void clear()
      清空所有path
      void closePath()
      闭合路径
      void destroy()
      销毁创建的 Shape 对象
      void ellipse​(float cx, float cy, float rx, float ry)
      添加一个椭圆
      void lineTo​(float x, float y)
      添加一条从上一个点到(x, y)的直线
      void moveTo​(float x, float y)
      设置下一个轮廓的起点为 (x, y)
      void quadTo​(float cx, float cy, float x, float y)
      从上一个点开始添加一条二次贝塞尔曲线
      void rect​(float x, float y, float w, float h)
      添加一个矩形
      void rotate​(float degrees)
      旋转一个角度
      void roundRect​(float x, float y, float w, float h, float r)
      添加一个圆角矩形
      void scale​(float x, float y)
      缩放
      void transform​(float[] transform)
      应用一个变换矩阵
      void translate​(float x, float y)
      应用一个位移
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SXShape

        public SXShape()
        创建一个 Shape

        1. 使用完成后, 调用 destroy 释放

    • Method Detail

      • clear

        public void clear()
        清空所有path
      • moveTo

        public void moveTo​(float x,
                           float y)
        设置下一个轮廓的起点为 (x, y)
      • lineTo

        public void lineTo​(float x,
                           float y)
        添加一条从上一个点到(x, y)的直线
      • bezierTo

        public void bezierTo​(float c1x,
                             float c1y,
                             float c2x,
                             float c2y,
                             float x,
                             float y)
        从上一个点开始添加一条三次贝塞尔曲线
      • quadTo

        public void quadTo​(float cx,
                           float cy,
                           float x,
                           float y)
        从上一个点开始添加一条二次贝塞尔曲线
      • arcTo

        public void arcTo​(float x1,
                          float y1,
                          float x2,
                          float y2,
                          float radius)
        以上一个点为起点添加一条弧线
      • closePath

        public void closePath()
        闭合路径
      • rect

        public void rect​(float x,
                         float y,
                         float w,
                         float h)
        添加一个矩形
      • roundRect

        public void roundRect​(float x,
                              float y,
                              float w,
                              float h,
                              float r)
        添加一个圆角矩形
      • ellipse

        public void ellipse​(float cx,
                            float cy,
                            float rx,
                            float ry)
        添加一个椭圆
      • circle

        public void circle​(float cx,
                           float cy,
                           float r)
        添加一个圆
      • rotate

        public void rotate​(float degrees)
        旋转一个角度
        Parameters:
        degrees - 旋转角度
      • translate

        public void translate​(float x,
                              float y)
        应用一个位移
      • scale

        public void scale​(float x,
                          float y)
        缩放
        Parameters:
        x - x轴缩放倍数
        y - y轴缩放倍数
      • transform

        public void transform​(float[] transform)
        应用一个变换矩阵
        Parameters:
        transform - 变换矩阵
      • destroy

        public void destroy()
        销毁创建的 Shape 对象