Background image in vBox in Flex

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.

+3
source share
1 answer
vBox.setStyle("backgroundSize", "100%");

Checkout backgroundSize style Containerclass

+1
source

Source: https://habr.com/ru/post/1750095/


All Articles