0
我想從JavaScript在HTML5畫布使用的語句轉化,如:如何將HTML5 Canvas弧()轉換爲JavaFX 2.x Canvas arc()?
ctx.arc(x, y, (rad+5)*factor, 0, Math.PI*2, true);
在JavaFX的等效聲明。
它會是什麼樣子?
作爲參考,在HTML5畫布弧()方法被定義爲:
x The x-coordinate of the center of the circle
y The y-coordinate of the center of the circle
r The radius of the circle
sAngle The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
eAngle The ending angle, in radians
counterclockwise Optional. Specifies whether the drawing should be counterclockwise or clockwise. False=clockwise, true=counter-clockwise
但JavaFX中它被定義爲:
public void arc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double length)
Adds path elements to the current path to make an arc that uses Euclidean degrees. This Euclidean orientation sweeps from East to North, then West, then South, then back to East.
Parameters:
centerX - the center x position of the arc.
centerY - the center y position of the arc.
radiusX - the x radius of the arc.
radiusY - the y radius of the arc.
startAngle - the starting angle of the arc in the range 0-360.0
length - the length of the baseline of the arc.
可能有人請告訴我什麼是JavaFX的圓弧()語句看起來像並解釋如何在這兩者之間進行轉換?或者我應該使用arcTo()或其他的東西?
謝謝。
酷感謝阿毛裏,正是我所期待的! – Qu0ll