L
L
lonata2018-12-06 21:48:47
JavaFX
lonata, 2018-12-06 21:48:47

Why are icons displayed in poor quality in Javafx?

I am writing an application in JavaFx, I added icons to the HBox, which is located in the AnchorPane, I do all this in the Scene Builder
. The icons are displayed as if in poor quality. Pixels are visible. Icons in png, 500x500
5c096ed48817a222049991.jpeg
Resolution 500x500:
5c096efa58a2c946220090.jpeg
I add icons via CSS:

.icon-image-pref {
    -fx-background-color: transparent;
    -fx-background-size: 80% 55%;
    -fx-background-repeat: no-repeat;
    -fx-background-position: center;
}

.btnPalette {
     -fx-background-image: url('resources/palette.png');
 }

.btnFonts {
    -fx-background-image: url('resources/fonts.png');
}

.btnQuestCards {
    -fx-background-image: url('resources/questcards.png');
}

.btnNonQuestCards {
    -fx-background-image: url('resources/non-quest-cards.png');
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question