pub struct Viewer<'a, 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
sourceimpl<'a, Handle> Viewer<'a, Handle>
impl<'a, Handle> Viewer<'a, Handle>
sourcepub fn max_scale(self, max_scale: f32) -> Viewer<'a, Handle>
pub fn max_scale(self, max_scale: f32) -> Viewer<'a, Handle>
Sets the max scale applied to the image of the Viewer
.
Default is 10.0
sourcepub fn min_scale(self, min_scale: f32) -> Viewer<'a, Handle>
pub fn min_scale(self, min_scale: f32) -> Viewer<'a, Handle>
Sets the min scale applied to the image of the Viewer
.
Default is 0.25
sourcepub fn scale_step(self, scale_step: f32) -> Viewer<'a, Handle>
pub fn scale_step(self, scale_step: f32) -> Viewer<'a, Handle>
Sets the percentage the image of the Viewer
will be scaled by
when zoomed in / out.
Default is 0.10
Trait Implementations
sourceimpl<'a, Message, Renderer, Handle> Widget<Message, Renderer> for Viewer<'a, Handle> where
Renderer: Renderer<Handle = Handle>,
Handle: Clone + Hash,
impl<'a, Message, Renderer, Handle> Widget<Message, Renderer> for Viewer<'a, Handle> where
Renderer: Renderer<Handle = Handle>,
Handle: Clone + Hash,
sourcefn on_event(
&mut self,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
sourcefn mouse_interaction(
&self,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle<f32>,
_renderer: &Renderer
) -> Interaction
fn mouse_interaction(
&self,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle<f32>,
_renderer: &Renderer
) -> Interaction
Returns the current mouse::Interaction
of the Widget
. Read more
Auto Trait Implementations
impl<'a, Handle> RefUnwindSafe for Viewer<'a, Handle> where
Handle: RefUnwindSafe,
impl<'a, Handle> Send for Viewer<'a, Handle> where
Handle: Send,
impl<'a, Handle> Sync for Viewer<'a, Handle> where
Handle: Sync,
impl<'a, Handle> Unpin for Viewer<'a, Handle> where
Handle: Unpin,
impl<'a, Handle> !UnwindSafe for Viewer<'a, Handle>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more