[−][src]Struct iced::widget::image::Image
A frame that displays an image while keeping aspect ratio.
It implements Widget
when the associated Renderer
implements the
image::Renderer
trait.
Example
use iced::Image; let image = Image::new(my_handle);
Methods
impl<I> Image<I>
[src]
pub fn new(image: I) -> Self
[src]
Creates a new Image
with given image handle.
pub fn clip(self, source: Rectangle<u16>) -> Self
[src]
Sets the portion of the Image
to draw.
pub fn width(self, width: u16) -> Self
[src]
Sets the width of the Image
boundaries in pixels.
pub fn height(self, height: u16) -> Self
[src]
Sets the height of the Image
boundaries in pixels.
pub fn align_self(self, align: Align) -> Self
[src]
Sets the alignment of the Image
itself.
This is useful if you want to override the default alignment given by the parent container.
Trait Implementations
impl<I, Message, Renderer> Widget<Message, Renderer> for Image<I> where
Renderer: Renderer<I>,
I: Clone,
[src]
Renderer: Renderer<I>,
I: Clone,
fn node(&self, renderer: &Renderer) -> Node
[src]
fn draw(
&self,
renderer: &mut Renderer,
layout: Layout,
_cursor_position: Point
) -> MouseCursor
[src]
&self,
renderer: &mut Renderer,
layout: Layout,
_cursor_position: Point
) -> MouseCursor
fn hash_layout(&self, state: &mut Hasher)
[src]
fn on_event(
&mut self,
_event: Event,
_layout: Layout,
_cursor_position: Point,
_messages: &mut Vec<Message>
)
[src]
&mut self,
_event: Event,
_layout: Layout,
_cursor_position: Point,
_messages: &mut Vec<Message>
)
impl<'a, I, Message, Renderer> From<Image<I>> for Element<'a, Message, Renderer> where
Renderer: Renderer<I>,
I: Clone + 'a,
[src]
Renderer: Renderer<I>,
I: Clone + 'a,
impl<I> Debug for Image<I>
[src]
Auto Trait Implementations
impl<I> Unpin for Image<I> where
I: Unpin,
I: Unpin,
impl<I> Sync for Image<I> where
I: Sync,
I: Sync,
impl<I> Send for Image<I> where
I: Send,
I: Send,
impl<I> RefUnwindSafe for Image<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> UnwindSafe for Image<I> where
I: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,