FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    current_transform

    fn current_transform(self: &Self) -> Matrix
    

    The current transform of the drawing context.

    Source

    draw_bitmap

    fn draw_bitmap(self: &mut Self, source: &Bitmap, rect: Rect)
    

    Draws a bitmap into rect.

    Source

    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.

    Source

    draw_line

    fn draw_line(self: &mut Self, pen: &ImmutablePen, p1: Point, p2: Point)
    

    Draws a line.

    Source

    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.

    Source

    draw_rectangle_outline

    fn draw_rectangle_outline(self: &mut Self, pen: &ImmutablePen, rect: Rect, corner_radius: f32)
    

    Draws the outline of a rectangle.

    Source

    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.

    Source

    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.

    Source

    fill_rectangle

    fn fill_rectangle(self: &mut Self, brush: &dyn IImmutableBrush, rect: Rect, corner_radius: f32)
    

    Draws a filled rectangle.

    Source

    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.

    Source

    push_rounded_clip

    fn push_rounded_clip(self: &mut Self, clip: RoundedRect) -> ImmediatePushedState
    

    Pushes a rounded clip rectangle.

    Source

    push_clip

    fn push_clip(self: &mut Self, clip: Rect) -> ImmediatePushedState
    

    Pushes a clip rectangle.

    Source

    push_opacity

    fn push_opacity(self: &mut Self, opacity: f64, bounds: Rect) -> ImmediatePushedState
    

    Pushes an opacity value.

    Source

    push_opacity_mask

    fn push_opacity_mask(self: &mut Self, mask: &dyn IImmutableBrush, bounds: Rect) -> ImmediatePushedState
    

    Pushes an opacity mask.

    Source

    push_post_transform

    fn push_post_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
    

    Pushes a matrix post-transformation.

    Source

    push_pre_transform

    fn push_pre_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
    

    Pushes a matrix pre-transformation.

    Source

    push_set_transform

    fn push_set_transform(self: &mut Self, matrix: Matrix) -> ImmediatePushedState
    

    Sets the current matrix transformation.

    Source

    push_transform_container

    fn push_transform_container(self: &mut Self) -> ImmediatePushedState
    

    Pushes a new transform context.

    Source

    dispose

    fn dispose(self: Self)
    

    Pops every state still pushed and releases the context (and the platform implementation, if the context owns it).

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • Drop

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.