Does anyone know the maximum dimensions of a canvas in JavaFX? From some tests it seams to be 8192 (the same of IE) and, by my side, this is strange. Maybe, is it modifiable?
Canvas class is a part of JavaFX. Canvas class basically creates an image that can be drawn on using a set of graphics commands provided by a GraphicsContext. Canvas has a specified height and width and all the drawing operations are clipped to the bounds of the canvas.
You can put your canvas into an AnchorPane and then you can add a Button to that too which will be shown on top of the canvas then. With the anchors you can place the button exactly where you want to have it.
This class is used to issue draw calls to a Canvas using a buffer. Each call pushes the necessary parameters onto the buffer where they will be later rendered onto the image of the Canvas node by the rendering thread at the end of a pulse.
You can draw text using the fillText() and strokeText() methods of the GraphicsContext using the following snippets of code: void strokeText(String text, double x, double y) void strokeText(String text, double x, double y, double maxWidth) void fillText(String text, double x, double y)
Likely it depends upon the maximum texture size for your video card as I believe, using the most common hardware accelerated rendering pipeline, the canvas will ultimately be represented as a texture. (I don't know this exactly, but I think it is a pretty good guess).
You can cross-post to openjfx-dev to get a developer to confirm.
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