pub struct Image { /* private fields */ }Implementations§
Source§impl Image
impl Image
pub fn new( layout_style: LayoutStyle, data_fn: impl Fn() -> Arc<ImageData> + 'static, filter_fn: impl Fn() -> ImageFilter + 'static, fit_fn: impl Fn() -> ObjectFit + 'static, ) -> Result<Self, LayoutError>
Sourcepub fn with_radius(self, radius: f32) -> Self
pub fn with_radius(self, radius: f32) -> Self
Rounds the picture’s own corners.
A StyledContainer around it cannot do this — its radius rounds the fill it paints, and a bitmap child
draws over that — so a thumbnail, an avatar or a cover in a rounded UI had no way to be anything but a
square. The clip primitive already carries a radius; this is the widget passing one through.
Sourcepub fn with_border_radius(self, radius: BorderRadius) -> Self
pub fn with_border_radius(self, radius: BorderRadius) -> Self
Rounds each corner separately, for a picture that meets an edge on one side only.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Image
impl !Send for Image
impl !Sync for Image
impl !UnwindSafe for Image
impl Freeze for Image
impl Unpin for Image
impl UnsafeUnpin for Image
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
fn layout_node(&self) -> NodeId
Source§fn pointer_opaque(&self) -> bool
fn pointer_opaque(&self) -> bool
Whether this widget stands in front of whatever its siblings drew underneath it, for a pointer event
its parent is hit-testing. Read more