[−][src]Struct iced::widget::canvas::Frame
feature="canvas"
or feature="glow_canvas"
only.The frame of a Canvas
.
Implementations
impl Frame
[src]
pub fn new(size: Size<f32>) -> Frame
[src]
feature="canvas"
or feature="glow_canvas"
only.Creates a new empty Frame
with the given dimensions.
The default coordinate system of a Frame
has its origin at the
top-left corner of its bounds.
pub fn width(&self) -> f32
[src]
feature="canvas"
or feature="glow_canvas"
only.Returns the width of the Frame
.
pub fn height(&self) -> f32
[src]
feature="canvas"
or feature="glow_canvas"
only.Returns the width of the Frame
.
pub fn size(&self) -> Size<f32>
[src]
feature="canvas"
or feature="glow_canvas"
only.Returns the dimensions of the Frame
.
pub fn center(&self) -> Point
[src]
feature="canvas"
or feature="glow_canvas"
only.Returns the coordinate of the center of the Frame
.
pub fn fill(&mut self, path: &Path, fill: impl Into<Fill>)
[src]
feature="canvas"
or feature="glow_canvas"
only.pub fn fill_rectangle(
&mut self,
top_left: Point,
size: Size<f32>,
fill: impl Into<Fill>
)
[src]
&mut self,
top_left: Point,
size: Size<f32>,
fill: impl Into<Fill>
)
feature="canvas"
or feature="glow_canvas"
only.Draws an axis-aligned rectangle given its top-left corner coordinate and
its Size
on the Frame
by filling it with the provided style.
pub fn stroke(&mut self, path: &Path, stroke: impl Into<Stroke>)
[src]
feature="canvas"
or feature="glow_canvas"
only.pub fn fill_text(&mut self, text: impl Into<Text>)
[src]
feature="canvas"
or feature="glow_canvas"
only.Draws the characters of the given Text
on the Frame
, filling
them with the given color.
Warning: Text currently does not work well with rotations and scale transforms! The position will be correctly transformed, but the resulting glyphs will not be rotated or scaled properly.
Additionally, all text will be rendered on top of all the layers of
a Canvas
. Therefore, it is currently only meant to be used for
overlays, which is the most common use case.
Support for vectorial text is planned, and should address all these limitations.
pub fn with_save(&mut self, f: impl FnOnce(&mut Frame))
[src]
feature="canvas"
or feature="glow_canvas"
only.Stores the current transform of the Frame
and executes the given
drawing operations, restoring the transform afterwards.
This method is useful to compose transforms and perform drawing operations in different coordinate systems.
pub fn translate(&mut self, translation: Vector<f32>)
[src]
feature="canvas"
or feature="glow_canvas"
only.Applies a translation to the current transform of the Frame
.
pub fn rotate(&mut self, angle: f32)
[src]
feature="canvas"
or feature="glow_canvas"
only.Applies a rotation to the current transform of the Frame
.
pub fn scale(&mut self, scale: f32)
[src]
feature="canvas"
or feature="glow_canvas"
only.Applies a scaling to the current transform of the Frame
.
pub fn into_geometry(self) -> Geometry
[src]
feature="canvas"
or feature="glow_canvas"
only.Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,