Arc (also you can use UniCanvas.BitmapCanvas.Arc)
1. UniCanvas -> ClientEvents -> ExtEvents -> function afterrender:
function afterrender(sender, eOpts)
{
sender.arc = function(x, y, r, sAngle, eAngle, counterClockWise) {
if (this._cc_) {
this._cc_.beginPath();
this._cc_.arc(x, y, r, sAngle, eAngle, counterClockWise);
this._cc_.fillStyle = this.brushColor;
this._cc_.fill();
this._cc_.lineWidth = this.lineWidth;
this._cc_.strokeStyle = this.strokeStyle;
this._cc_.stroke();
this._cc_.closePath()
}
}
}
2.
procedure TMainForm.UniButton1Click(Sender: TObject);
var
X1, Y1, R: Integer;
sAngle, eAngle: Double;
counterClockWise: Boolean;
begin
Randomize;
X1:=Random(Width div 2);
Y1:=Random(Height div 2);
R:=Random(Width div 4);
sAngle := 0;
eAngle := RandomRange(10, 200 + 1) * 0.01 * System.Pi;
counterClockWise := Boolean(Random(2));
UniCanvas1.Pen.Color:=Random($FFFFFF);
UniCanvas1.Brush.Color:=Random($FFFFFF);
UniCanvas1.JSInterface.JSCall(
'arc',
[
X1,
Y1,
R,
sAngle,
eAngle,
counterClockWise
]
);
end;