Show Menu
TOPICS×

fit

Response Image Fit Mode. Specifies how the scale factor is calculated, which is used to scale the composite image to the response image when the response size is specified with wid= and hei= and scl= is not present.
fit= * mode *, * upscale *
mode
fit|constrain|crop|wrap|stretch|hfit|vfit
upscale
0|1
In the following description of the mode options, it is assumed that xScale is the ratio of the composite image width to the response image width and yScale is the ratio of the composite image height to the response image height.
Parameter Definition
fit
Scales the composite image so that it fits into the space allocated with wid= and hei= , with minimal whitespace and no cropping. The response image will have the exact size specified with wid= and hei= . The smaller of xScale and yScale is applied.
constrain
Scales the composite image like fit so that it fits into the space allocated with wid= and hei= , but the actual response image may be smaller than specified with wid= and hei= to avoid whitespace. The smaller of xScale and yScale is applied.
crop
Scales the composite image so that it fills the entire response image, with minimal cropping and no whitespace. The larger of xScale and yScale is applied.
wrap
Scales the composite image like crop so that it covers the entire response image, but the actual response image may be larger than specified with wid= and hei= to avoid cropping. The larger of xScale and yScale is applied.
stretch
Scales the composite image independently in x and y to fill the entire response image, with no cropping and no whitespace. This typically changes the aspect ratio of the image. xScale is used for horizontal scaling and yScale for vertical scaling.
hfit
Applies xScale to tightly fit the image horizontally, with likely cropping or whitespace at the top and/or bottom. Useful for special applications.
vfit
Applies yScale to tightly fit the image vertically, with likely cropping or whitespace at the left and/or right. Useful for special applications.
Set upscale to '1' to allow upscaling or to '0' to constrain * xScale *and yScale to be limited to 1:1. If upscaling is disabled, additional whitespace may be present if the composite image is smaller than the response image.
Crop and whitespace are centered by default; their position can be controlled with align= . The color and opacity of the whitespace fill is determined by bgc= .

Properties

View attribute. Applies regardless of the current layer setting. At least one of wid= or hei= must also be specified, otherwise an error is returned; both wid= and hei= must be specified for the fit modes to behave as described. An error is returned when req=tmb is specified as well.

Default

fit=fit,0

See also