本文整理汇总了TypeScript中tabris.CanvasContext.bezierCurveTo方法的典型用法代码示例。如果您正苦于以下问题:TypeScript CanvasContext.bezierCurveTo方法的具体用法?TypeScript CanvasContext.bezierCurveTo怎么用?TypeScript CanvasContext.bezierCurveTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tabris.CanvasContext
的用法示例。
在下文中一共展示了CanvasContext.bezierCurveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: drawHermiteInterpolation
private drawHermiteInterpolation(ctx: CanvasContext, points: Point[]) {
ctx.strokeStyle = graphLineColor;
ctx.lineWidth = graphLineWidth;
for (let i = 0; i < points.length - 1; i++) {
ctx.beginPath();
let [b0, b3] = [points[i], points[i + 1]];
let h = (b3.x - b0.x) / 3;
let b1 = { x: b0.x + h, y: b0.y + (h * b0.dydx) };
let b2 = { x: b3.x - h, y: b3.y - (h * b3.dydx) };
ctx.moveTo(this.getX(b0.x), this.getY(b0.y));
ctx.bezierCurveTo(
this.getX(b1.x), this.getY(b1.y),
this.getX(b2.x), this.getY(b2.y),
this.getX(b3.x), this.getY(b3.y)
);
ctx.stroke();
}
}
示例2:
ctx.lineJoin = lineJoin;
ctx.lineWidth = lineWidth;
ctx.strokeStyle = strokeStyle;
ctx.textAlign = textAlign;
ctx.textBaseline = textBaseline;
// Methods
let num: number = 42;
let bool: boolean = false;
let voidReturnValue: void;
let imageData: ImageData;
let text: string = '';
voidReturnValue = ctx.arc(num, num, num, num, num, bool);
voidReturnValue = ctx.beginPath();
voidReturnValue = ctx.bezierCurveTo(num, num, num, num, num, num);
voidReturnValue = ctx.clearRect(num, num, num, num);
voidReturnValue = ctx.closePath();
imageData = ctx.createImageData(num, num);
imageData = ctx.createImageData(imageData);
voidReturnValue = ctx.fill();
voidReturnValue = ctx.fillRect(num, num, num, num);
voidReturnValue = ctx.fillText(text, num, num);
imageData = ctx.getImageData(num, num, num, num);
voidReturnValue = ctx.lineTo(num, num);
voidReturnValue = ctx.moveTo(num, num);
voidReturnValue = ctx.putImageData(imageData, num, num);
voidReturnValue = ctx.quadraticCurveTo(num, num, num, num);
voidReturnValue = ctx.rect(num, num, num, num);
voidReturnValue = ctx.restore();
voidReturnValue = ctx.rotate(num);