pub struct Paint { /* private fields */ }Expand description
绘图参数,控制路径的填充/描边及描边样式。 Paint - controls fill/stroke style and stroke parameters for path rendering.
用于 get_fill_path 将路径转换为描边后的填充路径(类似 StrokeRec,但包含 Style)。
Used with get_fill_path to convert path to stroked fill path (like StrokeRec, but includes Style).
Implementations§
Source§impl Paint
impl Paint
Sourcepub fn set_stroke(&mut self, enable: bool)
pub fn set_stroke(&mut self, enable: bool)
设置为描边样式。Sets to stroke style.
Sourcepub fn set_style(&mut self, style: PaintStyle)
pub fn set_style(&mut self, style: PaintStyle)
设置绘图样式。Sets paint style.
Sourcepub fn set_stroke_width(&mut self, width: f32)
pub fn set_stroke_width(&mut self, width: f32)
设置描边宽度。Sets stroke width (0 = hairline).
Sourcepub fn set_stroke_miter(&mut self, miter: f32)
pub fn set_stroke_miter(&mut self, miter: f32)
设置 Miter 限制。Sets miter limit for sharp corners.
Sourcepub fn set_stroke_cap(&mut self, cap: StrokeCap)
pub fn set_stroke_cap(&mut self, cap: StrokeCap)
设置线端样式。Sets line cap.
Sourcepub fn set_stroke_join(&mut self, join: StrokeJoin)
pub fn set_stroke_join(&mut self, join: StrokeJoin)
设置转角连接样式。Sets line join.
Sourcepub fn get_fill_path(&self, path: &Path) -> Option<Path>
pub fn get_fill_path(&self, path: &Path) -> Option<Path>
将路径转为填充等效路径。 Converts path to filled equivalent (applies stroke/style).
Fill 样式返回原路径副本;Stroke 样式返回描边后的填充路径。 Fill style returns copy of path; stroke style returns stroked fill path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Paint
impl RefUnwindSafe for Paint
impl !Send for Paint
impl !Sync for Paint
impl Unpin for Paint
impl UnsafeUnpin for Paint
impl UnwindSafe for Paint
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