pub struct PushedScope<'c, 'a> { /* private fields */ }Expand description
A pushed state that is popped when the guard goes out of scope. Derefs to the drawing context.
Methods from Deref<Target = DrawingContext<'a>>§
Sourcepub fn draw_image(&mut self, source: &dyn IImage, rect: Rect)
pub fn draw_image(&mut self, source: &dyn IImage, rect: Rect)
Draws an image into rect.
Sourcepub fn draw_image_with_rects(
&mut self,
source: &dyn IImage,
source_rect: Rect,
dest_rect: Rect,
)
pub fn draw_image_with_rects( &mut self, source: &dyn IImage, source_rect: Rect, dest_rect: Rect, )
Draws the part of an image inside source_rect into dest_rect.
Sourcepub fn draw_bitmap(
&mut self,
source: &RefCounted<SharedBitmapImpl>,
opacity: f64,
source_rect: Rect,
dest_rect: Rect,
)
pub fn draw_bitmap( &mut self, source: &RefCounted<SharedBitmapImpl>, opacity: f64, source_rect: Rect, dest_rect: Rect, )
Draws a platform bitmap.
Sourcepub fn draw_geometry(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
geometry: &Ref<Geometry>,
)
pub fn draw_geometry( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, geometry: &Ref<Geometry>, )
Draws a geometry.
Sourcepub fn draw_geometry_impl(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
geometry: &Arc<dyn IGeometryImpl>,
)
pub fn draw_geometry_impl( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, geometry: &Arc<dyn IGeometryImpl>, )
Draws a platform geometry.
Sourcepub fn draw_rectangle(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
rect: Rect,
radius_x: f64,
radius_y: f64,
box_shadows: &BoxShadows,
)
pub fn draw_rectangle( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rect: Rect, radius_x: f64, radius_y: f64, box_shadows: &BoxShadows, )
Draws a rectangle with the specified brush and pen.
The brush and the pen can both be None. If the brush is None, no
fill is performed. If the pen is None, no stroke is performed. If
both are None and there are no box shadows, the call is a no-op.
Sourcepub fn draw_rounded_rectangle(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
rrect: RoundedRect,
box_shadows: &BoxShadows,
)
pub fn draw_rounded_rectangle( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rrect: RoundedRect, box_shadows: &BoxShadows, )
Draws a rounded rectangle with the specified brush and pen.
Sourcepub fn draw_rectangle_outline(
&mut self,
pen: &Rc<dyn IPen>,
rect: Rect,
corner_radius: f32,
)
pub fn draw_rectangle_outline( &mut self, pen: &Rc<dyn IPen>, rect: Rect, corner_radius: f32, )
Draws the outline of a rectangle.
Sourcepub fn fill_rectangle(
&mut self,
brush: &Rc<dyn IBrush>,
rect: Rect,
corner_radius: f32,
)
pub fn fill_rectangle( &mut self, brush: &Rc<dyn IBrush>, rect: Rect, corner_radius: f32, )
Draws a filled rectangle.
Sourcepub fn draw_ellipse_at(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
center: Point,
radius_x: f64,
radius_y: f64,
)
pub fn draw_ellipse_at( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, center: Point, radius_x: f64, radius_y: f64, )
Draws an ellipse given its center and radii.
Sourcepub fn draw_ellipse(
&mut self,
brush: Option<&Rc<dyn IBrush>>,
pen: Option<&Rc<dyn IPen>>,
rect: Rect,
)
pub fn draw_ellipse( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rect: Rect, )
Draws an ellipse inscribed in a rectangle.
Sourcepub fn custom(&mut self, custom: &Arc<dyn ICustomDrawOperation>)
pub fn custom(&mut self, custom: &Arc<dyn ICustomDrawOperation>)
Draws a custom drawing operation.
Sourcepub fn draw_text(&mut self, text: &FormattedText, origin: Point)
pub fn draw_text(&mut self, text: &FormattedText, origin: Point)
Draws text. origin is the upper-left corner of the text.
Sourcepub fn draw_glyph_run(
&mut self,
foreground: Option<&Rc<dyn IBrush>>,
glyph_run: &Rc<GlyphRun>,
)
pub fn draw_glyph_run( &mut self, foreground: Option<&Rc<dyn IBrush>>, glyph_run: &Rc<GlyphRun>, )
Draws a glyph run.
Sourcepub fn draw_rectangle_acrylic(
&mut self,
material: &dyn IExperimentalAcrylicMaterial,
rect: RoundedRect,
)
pub fn draw_rectangle_acrylic( &mut self, material: &dyn IExperimentalAcrylicMaterial, rect: RoundedRect, )
Draws a rectangle filled with an acrylic-like material. A core
without acrylic support fills the rectangle with the fallback color
of the material; see
IDrawingContextCore::draw_rectangle_acrylic_core.
Sourcepub fn pop(&mut self, state: PushedState)
pub fn pop(&mut self, state: PushedState)
Pops a pushed state (C# PushedState.Dispose).
Panics if the state is not the most recently pushed one. Popping
PushedState::NONE, or any state after the context has been
disposed, does nothing.
Sourcepub fn scope(&mut self, state: PushedState) -> PushedScope<'_, 'a>
pub fn scope(&mut self, state: PushedState) -> PushedScope<'_, 'a>
Turns a pushed state into a guard that derefs to the context and pops the state when dropped.
Sourcepub fn push_rounded_clip(&mut self, clip: RoundedRect) -> PushedState
pub fn push_rounded_clip(&mut self, clip: RoundedRect) -> PushedState
Pushes a rounded clip rectangle.
Sourcepub fn push_clip(&mut self, clip: Rect) -> PushedState
pub fn push_clip(&mut self, clip: Rect) -> PushedState
Pushes a clip rectangle.
Sourcepub fn push_geometry_clip(&mut self, clip: &Ref<Geometry>) -> PushedState
pub fn push_geometry_clip(&mut self, clip: &Ref<Geometry>) -> PushedState
Pushes a clip geometry.
Sourcepub fn push_opacity(&mut self, opacity: f64) -> PushedState
pub fn push_opacity(&mut self, opacity: f64) -> PushedState
Pushes an opacity value.
Sourcepub fn push_opacity_mask(
&mut self,
mask: &Rc<dyn IBrush>,
bounds: Rect,
) -> PushedState
pub fn push_opacity_mask( &mut self, mask: &Rc<dyn IBrush>, bounds: Rect, ) -> PushedState
Pushes an opacity mask.
bounds are the bounds of the control, used to place brushes
correctly.
Sourcepub fn push_transform(&mut self, matrix: Matrix) -> PushedState
pub fn push_transform(&mut self, matrix: Matrix) -> PushedState
Pushes a matrix transformation.
Sourcepub fn push_render_options(
&mut self,
render_options: RenderOptions,
) -> PushedState
pub fn push_render_options( &mut self, render_options: RenderOptions, ) -> PushedState
Pushes render options.
Sourcepub fn push_text_options(&mut self, text_options: TextOptions) -> PushedState
pub fn push_text_options(&mut self, text_options: TextOptions) -> PushedState
Pushes text options.
Sourcepub fn push_effect(
&mut self,
effect: &Rc<dyn IEffect>,
bounds: Rect,
) -> PushedState
pub fn push_effect( &mut self, effect: &Rc<dyn IEffect>, bounds: Rect, ) -> PushedState
Pushes an effect applied to everything drawn until the state is
popped. bounds are the bounds of the affected content.
Trait Implementations§
Source§impl<'a> Deref for PushedScope<'_, 'a>
impl<'a> Deref for PushedScope<'_, 'a>
Source§impl DerefMut for PushedScope<'_, '_>
impl DerefMut for PushedScope<'_, '_>
Source§impl Drop for PushedScope<'_, '_>
impl Drop for PushedScope<'_, '_>
Auto Trait Implementations§
impl<'c, 'a> !RefUnwindSafe for PushedScope<'c, 'a>
impl<'c, 'a> !Send for PushedScope<'c, 'a>
impl<'c, 'a> !Sync for PushedScope<'c, 'a>
impl<'c, 'a> !UnwindSafe for PushedScope<'c, 'a>
impl<'c, 'a> Freeze for PushedScope<'c, 'a>
impl<'c, 'a> Unpin for PushedScope<'c, 'a>
impl<'c, 'a> UnsafeUnpin for PushedScope<'c, 'a>
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more