Transparency of the png image not displayed

Hello

I have a region that needs a background and an image 'up' of it.

I can put the bottom to aid

setStyle ("background - fx - color: #" + 123456 + ";");

Or I can use a Rectangle of this color.

Then I have an ImageView... spiralImgView = new ImageView (new Image ("images/spiral2.png"));

The png itself image has transparency in there.

So, when I add to the region...

this.getChildren () .addAll (rect, spiralImgView);

I just get a white background showing behind the image.

Can someone help me solve this problem?

Thank you

I did no programming.  This will tell you if your image:

(1) download and start a JavaFX scene generator

(2) without doing any change stick "background - fx - color: #1d1d1d; ' in the box 'Style' fenΩtre 'PropriΘtΘs '.

(3) drag and drop an Image seen in the scene from the "Library" window

4) click the ImageView in the window of "hierarchy".

(5) in the 'Properties' window, use the 'Image' selector to find your img disk

If your image is often transparent is the background is not white, but #1d1d1d

Tags: Java

Similar Questions

Maybe you are looking for