Skip to main content

StreamGeometryContext

Struct StreamGeometryContext 

Source
pub struct StreamGeometryContext { /* private fields */ }
Expand description

Describes a geometry using drawing commands.

This type is used to describe a stream geometry: obtain one by calling StreamGeometry::open. The context is completed when it is disposed or dropped.

Implementations§

Source§

impl StreamGeometryContext

Source

pub fn new(impl_: Box<dyn IStreamGeometryContextImpl>) -> Self

👎Deprecated:

Use StreamGeometry::open instead.

Creates a context over a platform implementation.

Source

pub fn precise_arc_to( &mut self, point: Point, size: Size, rotation_angle: f64, is_large_arc: bool, sweep_direction: SweepDirection, )

Draws an arc to the specified point using polylines, quadratic or cubic Bezier curves. This is significantly more precise when drawing elliptic arcs with extreme width:height ratios.

The parameters are those of IGeometryContext::arc_to:

  • point - The destination point where the arc ends.
  • size - The radii of an ellipse whose path is used to draw the arc.
  • rotation_angle - The rotation angle (in degrees) of the ellipse that specifies the path of the arc; positive values are clockwise. This will rotate the entire arc relative to the X-axis and is not commonly used.
  • is_large_arc - Specifies whether the arc should follow the longer path around an ellipse rather than the shorter one. true to draw the arc greater than 180 degrees; otherwise, false.
  • sweep_direction - A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.

Trait Implementations§

Source§

impl Drop for StreamGeometryContext

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl IGeometryContext for StreamGeometryContext

Source§

fn dispose(&mut self)

Finishes the drawing session.

Source§

fn set_fill_rule(&mut self, fill_rule: FillRule)

Sets the fill rule.
Source§

fn arc_to( &mut self, point: Point, size: Size, rotation_angle: f64, is_large_arc: bool, sweep_direction: SweepDirection, is_stroked: bool, )

Draws an arc to the specified point. Read more
Source§

fn begin_figure(&mut self, start_point: Point, is_filled: bool)

Begins a new figure.
Source§

fn cubic_bezier_to( &mut self, control_point1: Point, control_point2: Point, end_point: Point, is_stroked: bool, )

Draws a Bezier curve to the specified point.
Source§

fn quadratic_bezier_to( &mut self, control_point: Point, end_point: Point, is_stroked: bool, )

Draws a quadratic Bezier curve to the specified point.
Source§

fn line_to(&mut self, point: Point, is_stroked: bool)

Draws a line to the specified point.
Source§

fn end_figure(&mut self, is_closed: bool)

Ends the figure started by begin_figure.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.