-1
私は、カーソルをPhotoshopのブラシのようなものではなく塗りつぶしにしたいと思っていますが、カーソル上にイメージを置く方法だけが見つかりました。JavafXでカーソルを円に変更する方法は?
私は、カーソルをPhotoshopのブラシのようなものではなく塗りつぶしにしたいと思っていますが、カーソル上にイメージを置く方法だけが見つかりました。JavafXでカーソルを円に変更する方法は?
あなたはそれを行うために、ノードのスナップショットを使用することができます。
// create any shape you want (e.g. circle)
// set fill to null
Circle circle = new Circle(32, null);
// set stroke to required color
circle.setStroke(Color.BLACK);
// this is needed to 'cut' the fill from snapshot
SnapshotParameters sp = new SnapshotParameters();
sp.setFill(Color.TRANSPARENT);
// perform snapshot of the shape into an image
Image image = circle.snapshot(sp, null);
// set cursor from that image
scene.setCursor(new ImageCursor(image, 16, 16));
おかげで多くのことを、それが働いた:) – Madalina