pub struct Painter { /* private fields */ }Implementations§
Source§impl Painter
impl Painter
pub fn from_bitmap(bitmap: ImageBitmap) -> Self
Sourcepub fn from_bitmap_region(
bitmap: ImageBitmap,
source: Rect,
sampling: ImageSampling,
) -> Self
pub fn from_bitmap_region( bitmap: ImageBitmap, source: Rect, sampling: ImageSampling, ) -> Self
Creates a painter for one source region of a bitmap atlas.
Sourcepub fn from_bitmap_tiled(
bitmap: ImageBitmap,
source: Rect,
sampling: ImageSampling,
) -> Self
pub fn from_bitmap_tiled( bitmap: ImageBitmap, source: Rect, sampling: ImageSampling, ) -> Self
Creates a painter that repeats source at its own size across whatever
space it is given, instead of scaling it to fit.
A texture, a hatch or a skin background covers an area of any size
without going soft. source is a region of bitmap, so an application
tiles one sprite out of an atlas and never the whole sheet.
Sourcepub fn from_nine_patch(
bitmap: ImageBitmap,
source: Rect,
insets: NinePatchInsets,
center: PatchFill,
edges: PatchFill,
sampling: ImageSampling,
) -> Self
pub fn from_nine_patch( bitmap: ImageBitmap, source: Rect, insets: NinePatchInsets, center: PatchFill, edges: PatchFill, sampling: ImageSampling, ) -> Self
Creates a painter whose corners keep their own size while its edges and middle grow — one drawing of a button, panel or trough used at every size.
center and edges decide whether the growing parts are stretched or
tiled. Insets that leave no middle, or a destination with no room for
the corners, fall back to a plain scale rather than drawing corners over
each other.
pub fn from_svg(svg: SvgPainter) -> Self
pub fn intrinsic_size(&self) -> Size
pub fn as_bitmap(&self) -> Option<&ImageBitmap>
Sourcepub fn bitmap(&self) -> Option<&ImageBitmap>
pub fn bitmap(&self) -> Option<&ImageBitmap>
Returns the underlying bitmap when this painter is bitmap-backed.
Trait Implementations§
impl Eq for Painter
Source§impl From<ImageBitmap> for Painter
impl From<ImageBitmap> for Painter
Source§fn from(value: ImageBitmap) -> Self
fn from(value: ImageBitmap) -> Self
Source§impl From<SvgPainter> for Painter
impl From<SvgPainter> for Painter
Source§fn from(value: SvgPainter) -> Self
fn from(value: SvgPainter) -> Self
impl StructuralPartialEq for Painter
Auto Trait Implementations§
impl Freeze for Painter
impl RefUnwindSafe for Painter
impl Send for Painter
impl Sync for Painter
impl Unpin for Painter
impl UnsafeUnpin for Painter
impl UnwindSafe for Painter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more