zng_wgt_image

Function img_downscale

source
pub fn img_downscale(
    child: impl UiNode,
    downscale: impl IntoVar<Option<ImageDownscale>>,
) -> impl 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 to force the image pixels to be within an expected size. This property primary use is as error recover before the img_limits error happens, you set the limits to the size that should not even be processed and set this property to the maximum size expected.

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, this means that this property should never be used for responsive resize,use the widget size and other properties to efficiently resize an image on screen.