ImmediateDrawingContext
struct · ferroui-base · v0.5.0
struct ImmediateDrawingContext<'a>
A drawing context that draws immediately to a platform drawing context implementation, using immutable resources only. This is what custom draw operations render with.
Members
current_transformdraw_bitmapdraw_bitmap_rectsdraw_linedraw_rectangledraw_rectangle_outlinedraw_ellipsedraw_glyph_runfill_rectanglepoppush_rounded_clippush_clippush_opacitypush_opacity_maskpush_post_transformpush_pre_transformpush_set_transformpush_transform_containerdisposetry_get_feature
current_transform
fn current_transform(self: &Self) -> Matrix
The current transform of the drawing context.
draw_bitmap
fn draw_bitmap(self: &mut Self, source: &Bitmap, rect: Rect)
Draws a bitmap into rect.
draw_bitmap_rects
fn draw_bitmap_rects(self: &mut Self, source: &Bitmap, source_rect: Rect, dest_rect: Rect)
Draws the part of a bitmap inside source_rect into dest_rect.
draw_line
fn draw_line(self: &mut Self, pen: &ImmutablePen, p1: Point, p2: Point)
Draws a line.
draw_rectangle
fn draw_rectangle(self: &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.
draw_rectangle_outline
fn draw_rectangle_outline(self: &mut Self, pen: &ImmutablePen, rect: Rect, corner_radius: f32)
Draws the outline of a rectangle.
draw_ellipse
fn draw_ellipse(self: &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.
draw_glyph_run
fn draw_glyph_run(self: &mut Self, foreground: &dyn IImmutableBrush, glyph_run: &dyn IImmutableGlyphRunReference)
Draws a glyph run, if the reference still holds its platform glyph run.
fill_rectangle
fn fill_rectangle(self: &mut Self, brush: &dyn IImmutableBrush, rect: Rect, corner_radius: f32)
Draws a filled rectangle.
pop
fn pop(self: &mut Self, state: ImmediatePushedState)
Pops a pushed state (C# PushedState.Dispose). Panics if the state
is not the most recently pushed one.
push_rounded_clip
fn push_rounded_clip(self: &mut Self, clip: RoundedRect) -> ImmediatePushedState
Pushes a rounded clip rectangle.
push_clip
fn push_clip(self: &mut Self, clip: Rect) -> ImmediatePushedState
Pushes a clip rectangle.
push_opacity
fn push_opacity(self: &mut Self, opacity: f64, bounds: Rect) -> ImmediatePushedState
Pushes an opacity value.
push_opacity_mask
fn push_opacity_mask(self: &mut Self, mask: &dyn IImmutableBrush, bounds: Rect) -> ImmediatePushedState
Pushes an opacity mask.
push_post_transform
fn push_post_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
Pushes a matrix post-transformation.
push_pre_transform
fn push_pre_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
Pushes a matrix pre-transformation.
push_set_transform
fn push_set_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
Sets the current matrix transformation.
push_transform_container
fn push_transform_container(self: &mut Self) -> ImmediatePushedState
Pushes a new transform context.
dispose
fn dispose(self: Self)
Pops every state still pushed and releases the context (and the platform implementation, if the context owns it).
try_get_feature
fn try_get_feature(self: &mut Self, feature_type: TypeId) -> Option<Rc<dyn Any>>
Queries the platform drawing context implementation for an optional feature.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.