pub struct Viewer<Handle> { /* private fields */ }Available on crate feature
image only.Expand description
A frame that displays an image with the ability to zoom in/out and pan.
Implementations§
Source§impl<Handle> Viewer<Handle>
impl<Handle> Viewer<Handle>
Sourcepub fn filter_method(self, filter_method: FilterMethod) -> Self
pub fn filter_method(self, filter_method: FilterMethod) -> Self
Sets the FilterMethod of the Viewer.
Sourcepub fn content_fit(self, content_fit: ContentFit) -> Self
pub fn content_fit(self, content_fit: ContentFit) -> Self
Sets the ContentFit of the Viewer.
Sourcepub fn max_scale(self, max_scale: f32) -> Self
pub fn max_scale(self, max_scale: f32) -> Self
Sets the max scale applied to the image of the Viewer.
Default is 10.0
Sourcepub fn min_scale(self, min_scale: f32) -> Self
pub fn min_scale(self, min_scale: f32) -> Self
Sets the min scale applied to the image of the Viewer.
Default is 0.25
Sourcepub fn scale_step(self, scale_step: f32) -> Self
pub fn scale_step(self, scale_step: f32) -> Self
Sets the percentage the image of the Viewer will be scaled by
when zoomed in / out.
Default is 0.10
Trait Implementations§
Source§impl<'a, Message, Theme, Renderer, Handle> From<Viewer<Handle>> for Element<'a, Message, Theme, Renderer>
impl<'a, Message, Theme, Renderer, Handle> From<Viewer<Handle>> for Element<'a, Message, Theme, Renderer>
Source§impl<Message, Theme, Renderer, Handle> Widget<Message, Theme, Renderer> for Viewer<Handle>
impl<Message, Theme, Renderer, Handle> Widget<Message, Theme, Renderer> for Viewer<Handle>
Source§fn update(
&mut self,
tree: &mut Tree,
event: &Event,
layout: Layout<'_>,
cursor: Cursor,
renderer: &Renderer,
shell: &mut Shell<'_, Message>,
_viewport: &Rectangle,
)
fn update( &mut self, tree: &mut Tree, event: &Event, layout: Layout<'_>, cursor: Cursor, renderer: &Renderer, shell: &mut Shell<'_, Message>, _viewport: &Rectangle, )
Source§fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor: Cursor,
_viewport: &Rectangle,
_renderer: &Renderer,
) -> Interaction
fn mouse_interaction( &self, tree: &Tree, layout: Layout<'_>, cursor: Cursor, _viewport: &Rectangle, _renderer: &Renderer, ) -> Interaction
Source§fn draw(
&self,
tree: &Tree,
renderer: &mut Renderer,
_theme: &Theme,
_style: &Style,
layout: Layout<'_>,
_cursor: Cursor,
viewport: &Rectangle,
)
fn draw( &self, tree: &Tree, renderer: &mut Renderer, _theme: &Theme, _style: &Style, layout: Layout<'_>, _cursor: Cursor, viewport: &Rectangle, )
Draws the
Widget using the associated Renderer.Auto Trait Implementations§
impl<Handle> Freeze for Viewer<Handle>where
Handle: Freeze,
impl<Handle> RefUnwindSafe for Viewer<Handle>where
Handle: RefUnwindSafe,
impl<Handle> Send for Viewer<Handle>where
Handle: Send,
impl<Handle> Sync for Viewer<Handle>where
Handle: Sync,
impl<Handle> Unpin for Viewer<Handle>where
Handle: Unpin,
impl<Handle> UnsafeUnpin for Viewer<Handle>where
Handle: UnsafeUnpin,
impl<Handle> UnwindSafe for Viewer<Handle>where
Handle: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more