1,082 questions
2
votes
0
answers
76
views
Why does changing the FPS limit affect Graphics2D rendering performance?
I'm working with an AWT Canvas with a triple buffered BufferStrategy. The application runs a loop that renders the screen with a set maximum FPS. Specifically I'm drawing multiple characters on screen ...
3
votes
0
answers
158
views
Why does Java FontMetrics return wrong string bounds (specially height) for some .ttf?
I’m generating text images for different .ttf fonts in a method using Java2D, most of the fonts it works fine. The issue is with some fonts it return wrong "Y" value.
// params
File ...
3
votes
2
answers
104
views
Java2D Compositing - Incorrect Java/Oracle Documentation
I am going to improve and supplement this question but maybe I'm right and someone knowing can help shortcut this question/issue... Isn't the following web documentation by Oracle incorrect? https://...
1
vote
1
answer
83
views
When running java against a jar java2d is not being found? [duplicate]
I am using client host commands from powershell to launch a Oracle forms FSAL via the following command:
java -jar "fsal jar location" -url "url"
This command works except there ...
0
votes
1
answer
65
views
Java Graphics - Drawing multiple images next to each other creates empty lines
I am trying to draw the map of my game, it has tiles object with x & y location. The image of the tiles are hold by 1 class, and I resize them once I finished zooming.
I want to draw the images ...
0
votes
1
answer
110
views
How to include trailing space in text measurements using TextLayout?
I am using the java.awt.font.TextLayout class to measure the bounds of a text string. In this measurement I need to include any trailing whitespace. However it seems that by default, TextLayout ...
1
vote
1
answer
84
views
Clojure2d: drawing on the canvas silently fails if it has been resized
The following code successfully displays a blank canvas with a small red square:
(ns test-rect
(:require [clojure2d.core :as c2d])
(:require '[clojure2d.extra.utils :refer [show-image]]))
(c2d/...
0
votes
1
answer
402
views
Is it possible to render image from a PDF using PDFBox in a Spring Boot Native application?
I am trying to figure out how to use PDFBox (2.0.30) to render image from a PDF document in a native application based on Spring Boot (3.2.1).
PDF generation works fine, but image rendering fails. ...
1
vote
0
answers
33
views
Create Two Row image from Text in Java
I already have a working API in java that takes text in request, and creates a PNG image from this text using custom fonts and returns a BASE64 encoded data of the image.
Now, I need to modify this ...
0
votes
1
answer
116
views
Java 2D graphics backgammon table (algorithm question)
My problem is I need to use only one drawLine. I couldn't figure out how am I supposed to make changes at the same time in x and y while not messing with one and another. I can't use a rectangle.
int ...
0
votes
1
answer
48
views
Finding a square in a blank image
Let's say I have a JPG image that's completely white except for a green filled in square that's placed randomly. The square has equal side lengths of between 20 and 30 pixels.
I'd like to write a Java ...
0
votes
1
answer
245
views
Java Swing 2D - Draw many small stars quickly
I'm trying to make a game, and in the game is a background that has many small stars that slowly travel from right to left. With a full screen I may have 170 stars being drawn each frame. The ...
1
vote
0
answers
137
views
How to rotate and scale a Rectangle2D in java and return a Rectangle2D (not a Shape or Path2D)
Is it possible to scale or rotate a Rectangle2D and get a new transformed Rectangle2D?
I know it is possible to get a Shape or Path2D, but how to get a new Rectangle2D from a specific Affine transform ...
-1
votes
1
answer
56
views
Unable to drawimage on null layout swing
I want to draw some images on screen alongside some JButtons placed in different places of the screen. However whenever I have setLayout(null); the images do not show up on screen. If i don't set it ...
1
vote
1
answer
148
views
How do I make a top down view with the ability to rotate with built in java graphics?
I'm trying to make a racing game with the top down view on a static player in the middle of the screen, so instead of moving the player through the map, the map would move around the player. Since it'...