iced::widget::image::viewer

Function scaled_image_size

Source
pub fn scaled_image_size<Renderer>(
    renderer: &Renderer,
    handle: &<Renderer as Renderer>::Handle,
    state: &State,
    bounds: Size,
    content_fit: ContentFit,
) -> Size
where Renderer: Renderer,
Available on crate feature image only.
Expand description

Returns the bounds of the underlying image, given the bounds of the Viewer. Scaling will be applied and original aspect ratio will be respected.