本文整理匯總了TypeScript中tabris.CanvasContext.fillRect方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CanvasContext.fillRect方法的具體用法?TypeScript CanvasContext.fillRect怎麽用?TypeScript CanvasContext.fillRect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tabris.CanvasContext
的用法示例。
在下文中一共展示了CanvasContext.fillRect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: drawArea
private drawArea(ctx: CanvasContext, startTime: number, endTime: number, color: string) {
ctx.fillStyle = color;
let graphHeight = this.get("height") - margins.top - margins.bottom;
ctx.fillRect(this.getX(startTime),
this.getY(this.scale.maxY),
this.getX(endTime) - this.getX(startTime),
graphHeight
);
};
示例2: drawPoint
private drawPoint(ctx: CanvasContext, point: Point) {
ctx.fillStyle = graphLineColor;
ctx.fillRect(this.getX(point.x) - 2, this.getY(point.y) - 2, 4, 4);
}
示例3:
// 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);
voidReturnValue = ctx.save();
voidReturnValue = ctx.scale(num, num);
voidReturnValue = ctx.setTransform(num, num, num, num, num, num);
voidReturnValue = ctx.stroke();
voidReturnValue = ctx.strokeRect(num, num, num, num);
voidReturnValue = ctx.strokeText(text, num, num);