android.graphics.Path.rQuadTo()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中android.graphics.Path.rQuadTo()方法的一些代码示例,展示了Path.rQuadTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.rQuadTo()方法的具体详情如下:
包路径:android.graphics.Path
类名称:Path
方法名:rQuadTo

Path.rQuadTo介绍

暂无

代码示例

代码示例来源:origin: CarGuo/GSYVideoPlayer

mPath.moveTo(mCurrentRippleX, mCenterY);
for (int i = 0; i < 4; i++) {
  mPath.rQuadTo(mBaseRippleLength, -(1 - mFraction) * mBaseRippleLength, mBaseRippleLength * 2, 0);
  mPath.rQuadTo(mBaseRippleLength, (1 - mFraction) * mBaseRippleLength, mBaseRippleLength * 2, 0);

代码示例来源:origin: codeestX/ENViews

mBgPath.moveTo(mCurrentRippleX[index], mCurrentY);
for (int i = 0; i< 9 ; i++) {
  mBgPath.rQuadTo(mBgBaseLength / 2, mBgBaseLength / 8, mBgBaseLength, 0);
  mBgPath.rQuadTo(mBgBaseLength / 2, - mBgBaseLength / 8, mBgBaseLength, 0);

代码示例来源:origin: codeestX/ENViews

mPath.moveTo(mCurrentRippleX , mCenterY);
for (int i = 0; i< 4 ; i++) {
  mPath.rQuadTo(mBaseRippleLength, -(1 - mFraction) * mBaseRippleLength, mBaseRippleLength * 2, 0);
  mPath.rQuadTo(mBaseRippleLength, (1 - mFraction) * mBaseRippleLength, mBaseRippleLength * 2, 0);

代码示例来源:origin: scwang90/SmartRefreshLayout

break;
case 'q': // Draws a quadratic Bezier (relative)
  path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
  ctrlPointX = currentX + val[k + 0];
  ctrlPointY = currentY + val[k + 1];
    reflectiveCtrlPointY = currentY - ctrlPointY;
  path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY,
      val[k + 0], val[k + 1]);
  ctrlPointX = currentX + reflectiveCtrlPointX;

代码示例来源:origin: robolectric/robolectric

break;
case 'q': // Draws a quadratic Bézier (relative)
 path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
 ctrlPointX = currentX + val[k + 0];
 ctrlPointY = currentY + val[k + 1];
  reflectiveCtrlPointY = currentY - ctrlPointY;
 path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY, val[k + 0], val[k + 1]);
 ctrlPointX = currentX + reflectiveCtrlPointX;
 ctrlPointY = currentY + reflectiveCtrlPointY;

代码示例来源:origin: andkulikov/Transitions-Everywhere

break;
case 'q': // Draws a quadratic Bézier (relative)
  path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
  ctrlPointX = currentX + val[k + 0];
  ctrlPointY = currentY + val[k + 1];
    reflectiveCtrlPointY = currentY - ctrlPointY;
  path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY,
    val[k + 0], val[k + 1]);
  ctrlPointX = currentX + reflectiveCtrlPointX;

代码示例来源:origin: tarek360/RichPath

break;
case 'q': // Draws a quadratic Bézier (relative)
  path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
  ctrlPointX = currentX + val[k + 0];
  ctrlPointY = currentY + val[k + 1];
    reflectiveCtrlPointY = currentY - ctrlPointY;
  path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY,
      val[k + 0], val[k + 1]);
  ctrlPointX = currentX + reflectiveCtrlPointX;

代码示例来源:origin: jaredrummler/AnimatedSvgView

break;
case 'q': // Draws a quadratic Bézier (relative)
 path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
 ctrlPointX = currentX + val[k + 0];
 ctrlPointY = currentY + val[k + 1];
  reflectiveCtrlPointY = currentY - ctrlPointY;
 path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY,
   val[k + 0], val[k + 1]);
 ctrlPointX = currentX + reflectiveCtrlPointX;

代码示例来源:origin: michaldrabik/TapBarMenu

private Path createRoundedRectPathPreApi21(Path path, float left, float top, float right, float bottom, float rx, float ry) {
 if (rx < 0) rx = 0;
 if (ry < 0) ry = 0;
 float width = right - left;
 float height = bottom - top;
 if (rx > width / 2) rx = width / 2;
 if (ry > height / 2) ry = height / 2;
 float widthMinusCorners = (width - (2 * rx));
 float heightMinusCorners = (height - (2 * ry));
 path.moveTo(right, top + ry);
 path.rQuadTo(0, -ry, -rx, -ry);
 path.rLineTo(-widthMinusCorners, 0);
 path.rQuadTo(-rx, 0, -rx, ry);
 path.rLineTo(0, heightMinusCorners);
 path.rQuadTo(0, ry, rx, ry);
 path.rLineTo(widthMinusCorners, 0);
 path.rQuadTo(rx, 0, rx, -ry);
 path.rLineTo(0, -heightMinusCorners);
 path.close();
 return path;
}

代码示例来源:origin: posm/OpenMapKitAndroid

@Override
public void rQuadTo(float dx1, float dy1, float dx2, float dy2) {
  super.rQuadTo(dx1, dy1, dx2, dy2);
}

代码示例来源:origin: luhaoaimama1/zone-sdk

public void rQuadTo(ZPointF control, ZPointF point) {
  super.rQuadTo(control.x, control.y, point.x, point.y);
}

代码示例来源:origin: AlexMofer/ProjectX

/**
 * Same as quadTo, but the coordinates are considered relative to the last
 * point on this contour. If there is no previous point, then a moveTo(0,0)
 * is inserted automatically.
 *
 * @param dx1 The amount to add to the x-coordinate of the last point on
 *            this contour, for the control point of a quadratic curve
 * @param dy1 The amount to add to the y-coordinate of the last point on
 *            this contour, for the control point of a quadratic curve
 * @param dx2 The amount to add to the x-coordinate of the last point on
 *            this contour, for the end point of a quadratic curve
 * @param dy2 The amount to add to the y-coordinate of the last point on
 *            this contour, for the end point of a quadratic curve
 */
public void rQuadTo(float dx1, float dy1, float dx2, float dy2) {
  mPath.rQuadTo(dx1, dy1, dx2, dy2);
}

代码示例来源:origin: Jichensheng/BaiduWave

private Path getActionPath(float percent) {
  Path path = new Path();
  int x = -mWidth;
  //当前x点坐标(根据动画进度水平推移,一个动画周期推移的距离为一个mWidth)
  x += percent * mWidth;
  //波形的起点
  path.moveTo(x, mHeight / 2);
  //控制点的相对宽度
  int quadWidth = mWidth / 4;
  //控制点的相对高度
  int quadHeight = mHeight / 20 * 3;
  //第一个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //第二个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //右侧的直线
  path.lineTo(x + mWidth * 2, mHeight);
  //下边的直线
  path.lineTo(x, mHeight);
  //自动闭合补出左边的直线
  path.close();
  return path;
}

代码示例来源:origin: Jichensheng/BaiduWave

private Path getActionPath(float percent) {
  Path path = new Path();
  int x = -mWidth;
  //当前x点坐标(根据动画进度水平推移,一个动画周期推移的距离为一个mWidth)
  x += percent * mWidth;
  //波形的起点
  path.moveTo(x, mHeight / 2);
  //控制点的相对宽度
  int quadWidth = mWidth / 4;
  //控制点的相对高度
  int quadHeight = mHeight / 20 * 3;
  //第一个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //第二个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //右侧的直线
  path.lineTo(x + mWidth * 2, mHeight);
  //下边的直线
  path.lineTo(x, mHeight);
  //自动闭合补出左边的直线
  path.close();
  return path;
}

代码示例来源:origin: Jichensheng/BaiduWave

private Path getActionPath(float percent) {
  Path path = new Path();
  int x = -mWidth;
  //当前x点坐标(根据动画进度水平推移,一个动画周期推移的距离为一个mWidth)
  x += percent * mWidth;
  //波形的起点
  path.moveTo(x, mHeight / 2);
  //控制点的相对宽度
  int quadWidth = mWidth / 4;
  //控制点的相对高度
  int quadHeight = mHeight / 20 * 3;
  //第一个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //第二个周期
  path.rQuadTo(quadWidth, quadHeight, quadWidth * 2, 0);
  path.rQuadTo(quadWidth, -quadHeight, quadWidth * 2, 0);
  //右侧的直线
  path.lineTo(x + mWidth * 2, mHeight);
  //下边的直线
  path.lineTo(x, mHeight);
  //自动闭合补出左边的直线
  path.close();
  return path;
}

代码示例来源:origin: behumble/excanvas

@Override
public void rQuadTo(float dx1, float dy1, float dx2, float dy2) {
  super.rQuadTo(dx1, dy1, dx2, dy2);
  Instruction op = new Instruction(ID_RQUAD_TO_float_float_float_float, new Object[] {dx1, dy1, dx2, dy2});
  opList.add(op);
  if(ExCanvas.debug) {
    Log.d(TAG, "rQuadTo("+dx1+","+dy1+","+dx2+","+dy2+")");
  }
}

代码示例来源:origin: cjiahuan/WaveProgressBar

path.moveTo(baseX, wave_height);
for (int i = 0; i < 2; i++) {
  path.rQuadTo(quarter_side_length, -dwave, half_side_length, 0);
  path.rQuadTo(quarter_side_length, dwave, half_side_length, 0);
path.moveTo(baseX - eighth_side_length, wave_height);
for (int i = 0; i < 3; i++) {
  path.rQuadTo(quarter_side_length, dwave, half_side_length, 0);
  path.rQuadTo(quarter_side_length, -dwave, half_side_length, 0);

代码示例来源:origin: zincPower/UI2018

/**
 * @param path       路径
 * @param length     浪花的宽度
 * @param height     浪花的高度
 * @param isClose    是否要闭合
 * @param lengthTime 浪花长的倍数
 */
private void initPath(Path path, int length, int height, boolean isClose, float lengthTime) {
  // 初始化 小船的路径
  path.moveTo(-length, mHeight / 2);
  for (int i = -length; i < mWidth * lengthTime + length; i += length) {
    // rQuadTo 和 quadTo 区别在于
    // rQuadTo 是相对上一个点 而 quadTo是相对于画布
    path.rQuadTo(length / 4,
        -height,
        length / 2,
        0);
    path.rQuadTo(length / 4,
        height,
        length / 2,
        0);
  }
  if (isClose) {
    path.rLineTo(0, mHeight / 2);
    path.rLineTo(-(mWidth * 2 + 2 * length), 0);
    path.close();
  }
}

代码示例来源:origin: fanbaoying/FBYIDCardRecognition-Android

path.rQuadTo(0, -ry, -rx, -ry);
path.rLineTo(-widthMinusCorners, 0);
path.rQuadTo(-rx, 0, -rx, ry);
path.rLineTo(0, heightMinusCorners);
  path.rLineTo(0, -ry);
} else {
  path.rQuadTo(0, ry, rx, ry);
  path.rLineTo(widthMinusCorners, 0);
  path.rQuadTo(rx, 0, rx, -ry);

代码示例来源:origin: mukeshsolanki/android-otpview-pinview

path.moveTo(l, t + ry);
if (tl) {
 path.rQuadTo(0, -ry, rx, -ry);
} else {
 path.rLineTo(0, -ry);
 path.rQuadTo(rx, 0, rx, ry);
} else {
 path.rLineTo(rx, 0);
 path.rQuadTo(0, ry, -rx, ry);
} else {
 path.rLineTo(0, ry);
 path.rQuadTo(-rx, 0, -rx, -ry);
} else {
 path.rLineTo(-rx, 0);

相关文章