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.