I was introduced the following code to set the background image to a single vBox.
vBox.setStyle("backgroundImage", "PreviewBackground.png");
vBox.setStyle("backgroundAttachment", "fixed");
Where the height and width of the vBox was 250 x 350 and the height and width of the background image was 400 x 400. The problem is that the background image does not display the full image. Image is cropped. How can I show the full image as a background image?
Thanks in advance.
source
share