pub struct ImmediateDrawingContext<'a> { /* private fields */ }Expand description
A drawing context that draws immediately to a platform drawing context implementation, using immutable resources only. This is what custom draw operations render with.
Implementations§
Source§impl<'a> ImmediateDrawingContext<'a>
impl<'a> ImmediateDrawingContext<'a>
Sourcepub fn new(platform_impl: Box<dyn IDrawingContextImpl + 'a>) -> Self
pub fn new(platform_impl: Box<dyn IDrawingContextImpl + 'a>) -> Self
Creates a context that owns platform_impl and disposes it with the
context.
Sourcepub fn borrowed(platform_impl: &'a mut dyn IDrawingContextImpl) -> Self
pub fn borrowed(platform_impl: &'a mut dyn IDrawingContextImpl) -> Self
Creates a context over a borrowed implementation.
Sourcepub fn borrowed_with_transform(
platform_impl: &'a mut dyn IDrawingContextImpl,
transform: Matrix,
) -> Self
pub fn borrowed_with_transform( platform_impl: &'a mut dyn IDrawingContextImpl, transform: Matrix, ) -> Self
Creates a context over a borrowed implementation with an explicit container transform.
Sourcepub fn platform_impl(&mut self) -> &mut (dyn IDrawingContextImpl + 'a)
pub fn platform_impl(&mut self) -> &mut (dyn IDrawingContextImpl + 'a)
The platform drawing context implementation.
Sourcepub fn current_transform(&self) -> Matrix
pub fn current_transform(&self) -> Matrix
The current transform of the drawing context.
Sourcepub fn draw_bitmap(&mut self, source: &Bitmap, rect: Rect)
pub fn draw_bitmap(&mut self, source: &Bitmap, rect: Rect)
Draws a bitmap into rect.
Sourcepub fn draw_bitmap_rects(
&mut self,
source: &Bitmap,
source_rect: Rect,
dest_rect: Rect,
)
pub fn draw_bitmap_rects( &mut self, source: &Bitmap, source_rect: Rect, dest_rect: Rect, )
Draws the part of a bitmap inside source_rect into dest_rect.
Sourcepub fn draw_bitmap_impl(
&mut self,
source: &dyn IBitmapImpl,
source_rect: Rect,
dest_rect: Rect,
)
pub fn draw_bitmap_impl( &mut self, source: &dyn IBitmapImpl, source_rect: Rect, dest_rect: Rect, )
Draws a platform bitmap: draw_bitmap_rects
for callers that hold the platform implementation only.
Sourcepub fn draw_line(&mut self, pen: &ImmutablePen, p1: Point, p2: Point)
pub fn draw_line(&mut self, pen: &ImmutablePen, p1: Point, p2: Point)
Draws a line.
Sourcepub fn draw_rectangle(
&mut self,
brush: Option<&dyn IImmutableBrush>,
pen: Option<&ImmutablePen>,
rect: Rect,
radius_x: f64,
radius_y: f64,
box_shadows: &BoxShadows,
)
pub fn draw_rectangle( &mut self, brush: Option<&dyn IImmutableBrush>, pen: Option<&ImmutablePen>, rect: Rect, radius_x: f64, radius_y: f64, box_shadows: &BoxShadows, )
Draws a rectangle with the specified brush and pen.
Sourcepub fn draw_rectangle_outline(
&mut self,
pen: &ImmutablePen,
rect: Rect,
corner_radius: f32,
)
pub fn draw_rectangle_outline( &mut self, pen: &ImmutablePen, rect: Rect, corner_radius: f32, )
Draws the outline of a rectangle.
Sourcepub fn draw_ellipse(
&mut self,
brush: Option<&dyn IImmutableBrush>,
pen: Option<&ImmutablePen>,
center: Point,
radius_x: f64,
radius_y: f64,
)
pub fn draw_ellipse( &mut self, brush: Option<&dyn IImmutableBrush>, pen: Option<&ImmutablePen>, center: Point, radius_x: f64, radius_y: f64, )
Draws an ellipse with the specified brush and pen.
Sourcepub fn draw_glyph_run(
&mut self,
foreground: &dyn IImmutableBrush,
glyph_run: &dyn IImmutableGlyphRunReference,
)
pub fn draw_glyph_run( &mut self, foreground: &dyn IImmutableBrush, glyph_run: &dyn IImmutableGlyphRunReference, )
Draws a glyph run, if the reference still holds its platform glyph run.
Sourcepub fn fill_rectangle(
&mut self,
brush: &dyn IImmutableBrush,
rect: Rect,
corner_radius: f32,
)
pub fn fill_rectangle( &mut self, brush: &dyn IImmutableBrush, rect: Rect, corner_radius: f32, )
Draws a filled rectangle.
Sourcepub fn pop(&mut self, state: ImmediatePushedState)
pub fn pop(&mut self, state: ImmediatePushedState)
Pops a pushed state (C# PushedState.Dispose). Panics if the state
is not the most recently pushed one.
Sourcepub fn push_rounded_clip(&mut self, clip: RoundedRect) -> ImmediatePushedState
pub fn push_rounded_clip(&mut self, clip: RoundedRect) -> ImmediatePushedState
Pushes a rounded clip rectangle.
Sourcepub fn push_clip(&mut self, clip: Rect) -> ImmediatePushedState
pub fn push_clip(&mut self, clip: Rect) -> ImmediatePushedState
Pushes a clip rectangle.
Sourcepub fn push_opacity(
&mut self,
opacity: f64,
bounds: Rect,
) -> ImmediatePushedState
pub fn push_opacity( &mut self, opacity: f64, bounds: Rect, ) -> ImmediatePushedState
Pushes an opacity value.
Sourcepub fn push_opacity_mask(
&mut self,
mask: &dyn IImmutableBrush,
bounds: Rect,
) -> ImmediatePushedState
pub fn push_opacity_mask( &mut self, mask: &dyn IImmutableBrush, bounds: Rect, ) -> ImmediatePushedState
Pushes an opacity mask.
Sourcepub fn push_post_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
pub fn push_post_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
Pushes a matrix post-transformation.
Sourcepub fn push_pre_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
pub fn push_pre_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
Pushes a matrix pre-transformation.
Sourcepub fn push_set_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
pub fn push_set_transform(&mut self, matrix: Matrix) -> ImmediatePushedState
Sets the current matrix transformation.
Sourcepub fn push_transform_container(&mut self) -> ImmediatePushedState
pub fn push_transform_container(&mut self) -> ImmediatePushedState
Pushes a new transform context.
Trait Implementations§
Source§impl Drop for ImmediateDrawingContext<'_>
impl Drop for ImmediateDrawingContext<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ImmediateDrawingContext<'a>
impl<'a> !Send for ImmediateDrawingContext<'a>
impl<'a> !Sync for ImmediateDrawingContext<'a>
impl<'a> !UnwindSafe for ImmediateDrawingContext<'a>
impl<'a> Freeze for ImmediateDrawingContext<'a>
impl<'a> Unpin for ImmediateDrawingContext<'a>
impl<'a> UnsafeUnpin for ImmediateDrawingContext<'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