img_downscale

Function img_downscale 

Source
pub fn img_downscale(
    child: impl IntoUiNode,
    downscale: impl IntoVar<Option<ImageDownscaleMode>>,
) -> UiNode
Expand description

P Custom pixel resize applied during image load/decode.

Note that this resize affects the image actual pixel size directly when it is loading, it can also generate multiple image entries.

If the image is smaller than the requested size it is not upscaled. If multiple downscale samples are requested they are generated as synthetic ImageEntryKind::Reduced.

Changing this value after an image is already loaded or loading will cause the image to reload, image cache allocates different entries for different downscale values, prefer setting samples of all possible sizes at once to avoid generating multiple image entries in the cache.

Rendering large (gigapixel) images can become slow if the image is scaled to fit as render scaling is GPU optimized, generating mipmap alternates here is a good optimization for large image viewers.

This property sets the IMAGE_DOWNSCALE_VAR.