I have a Text object, where is something written - a letter or sentence. How can I convert this text into an image in javafx and then show it as image. I can't use Labels, because I need to have possibility of editing any pixel of this converted image.
Any advice is appreciated.
private WritableImage textToImage(String text) {
Text t = new Text(text);
Scene scene = new Scene(new StackPane(t));
return t.snapshot(null, null);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With