Class BackgroundImage
java.lang.Object
javafx.scene.layout.BackgroundImage
- All Implemented Interfaces:
- Interpolatable<BackgroundImage>
Defines properties describing how to render an image as the background to
 some 
Region. A BackgroundImage must have an Image specified (it cannot be
 null). The repeatX and repeatY
 properties define how the image is to be repeated in each direction. The
 position property defines how to position the image on the
 Region while the size property defines the size of the image
 on the Region. For example, the size might be defined with
 cover = true, meaning the image
 should be stretched to cover the entire rendering surface of the Region.
 Because the BackgroundImage is immutable, it can safely be used in any cache, and can safely be reused among multiple Regions.
- Since:
- JavaFX 8.0
- 
Constructor SummaryConstructorsConstructorDescriptionBackgroundImage(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) Creates a new BackgroundImage.
- 
Method SummaryModifier and TypeMethodDescriptionfinal ImagegetImage()The image to be used.final BackgroundPositionThe position of this BackgroundImage relative to the Region.final BackgroundRepeatIndicates in what manner (if at all) the background image is to be repeated along the x-axis of the region.final BackgroundRepeatIndicates in what manner (if at all) the background image is to be repeated along the y-axis of the region.final BackgroundSizegetSize()The size of this image relative to the Region.interpolate(BackgroundImage endValue, double t) Returns an intermediate value between the value of thisInterpolatableand the specifiedendValueusing the linear interpolation factort, ranging from 0 (inclusive) to 1 (inclusive).
- 
Constructor Details- 
BackgroundImagepublic BackgroundImage(Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY, BackgroundPosition position, BackgroundSize size) Creates a new BackgroundImage. Theimagemust be specified.- Parameters:
- image- The image to use. This cannot be null.
- repeatX- The BackgroundRepeat for the x axis. If null, this value defaults to REPEAT.
- repeatY- The BackgroundRepeat for the y axis. If null, this value defaults to REPEAT.
- position- The BackgroundPosition to use. If null, defaults to BackgroundPosition.DEFAULT.
- size- The BackgroundSize. If null, defaults to BackgroundSize.DEFAULT.
 
 
- 
- 
Method Details- 
getImage
- 
getRepeatXIndicates in what manner (if at all) the background image is to be repeated along the x-axis of the region. This will never be null.- Interpolation Type:
- discrete
- Returns:
- the BackgroundRepeat that indicates if the background image is to be repeated along the x-axis of the region
 
- 
getRepeatYIndicates in what manner (if at all) the background image is to be repeated along the y-axis of the region. This will never be null.- Interpolation Type:
- discrete
- Returns:
- the BackgroundRepeat that indicates if the background image is to be repeated along the y-axis of the region
 
- 
getPositionThe position of this BackgroundImage relative to the Region. Note that any position outside the background area of the region will be clipped.- Interpolation Type:
- default
- Returns:
- the position of this BackgroundImage relative to the Region
 
- 
getSizeThe size of this image relative to the Region.- Interpolation Type:
- default
- Returns:
- the size of this image relative to the Region
 
- 
interpolateReturns an intermediate value between the value of thisInterpolatableand the specifiedendValueusing the linear interpolation factort, ranging from 0 (inclusive) to 1 (inclusive).The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value. - Specified by:
- interpolatein interface- Interpolatable<BackgroundImage>
- Parameters:
- endValue- the target value
- t- the interpolation factor
- Returns:
- the intermediate value
- Throws:
- NullPointerException- if- endValueis- null
- Since:
- 24
 
 
-