We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to draw FontIcon (Ikonli) directly inside "javafx.scene.Canvas" ? Version 12.3.1
Thank's
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.SnapshotParameters; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.image.Image; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; import javafx.stage.Stage; import org.kordamp.ikonli.fontawesome5.FontAwesomeSolid; import org.kordamp.ikonli.javafx.FontIcon; public class IkonliCanvas extends Application { @Override public void start(Stage primaryStage) { // Criar um Canvas Canvas canvas = new Canvas(100, 400 ); GraphicsContext gc = canvas.getGraphicsContext2D(); Pane pcanvas = new Pane(); pcanvas.getChildren().add(canvas); FontIcon fi = new FontIcon(FontAwesomeSolid.APPLE_ALT); fi.setIconSize(30); Image snapshot = fi.snapshot(new SnapshotParameters(), null); gc.drawImage(snapshot, 40,100); Pane p = new Pane(); p.getChildren().add(fi); p.setPrefWidth(100); fi.setLayoutX(40); fi.setLayoutY(100); BorderPane bp = new BorderPane(); bp.setLeft(p); bp.setCenter(pcanvas); Scene scene = new Scene(bp, 220,400); primaryStage.setScene(scene); primaryStage.setTitle("Canvas Ikonli"); primaryStage.show(); } public static void main(String[] args) { launch(args); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to draw FontIcon (Ikonli) directly inside "javafx.scene.Canvas" ?
Version 12.3.1
Thank's
The text was updated successfully, but these errors were encountered: