iced::advanced::image

Trait Renderer

pub trait Renderer: Renderer {
    type Handle: Clone;

    // Required methods
    fn measure_image(&self, handle: &Self::Handle) -> Size<u32>;
    fn draw_image(&mut self, image: Image<Self::Handle>, bounds: Rectangle);
}
Available on crate feature advanced only.
Expand description

A Renderer that can render raster graphics.

Required Associated Types§

type Handle: Clone

The image Handle to be displayed. Iced exposes its own default implementation of a Handle

Required Methods§

fn measure_image(&self, handle: &Self::Handle) -> Size<u32>

Returns the dimensions of an image for the given Handle.

fn draw_image(&mut self, image: Image<Self::Handle>, bounds: Rectangle)

Draws an Image inside the provided bounds.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Renderer for ()

§

type Handle = Handle

§

fn measure_image(&self, _handle: &<() as Renderer>::Handle) -> Size<u32>

§

fn draw_image(&mut self, _image: Image, _bounds: Rectangle)

Source§

impl Renderer for Renderer

Available on crate feature image only.
Source§

type Handle = Handle

Source§

fn measure_image(&self, handle: &<Renderer as Renderer>::Handle) -> Size<u32>

Source§

fn draw_image(&mut self, image: Image, bounds: Rectangle)

Source§

impl Renderer for Renderer

Available on crate feature image only.
Source§

type Handle = Handle

Source§

fn measure_image(&self, handle: &<Renderer as Renderer>::Handle) -> Size<u32>

Source§

fn draw_image(&mut self, image: Image, bounds: Rectangle)

Source§

impl<A, B> Renderer for Renderer<A, B>
where A: Renderer, B: Renderer<Handle = <A as Renderer>::Handle>,

Source§

type Handle = <A as Renderer>::Handle

Source§

fn measure_image( &self, handle: &<Renderer<A, B> as Renderer>::Handle, ) -> Size<u32>

Source§

fn draw_image( &mut self, image: Image<<A as Renderer>::Handle>, bounds: Rectangle, )

Implementors§