Struct native_windows_gui::PlottersDrawingArea [−][src]
pub struct PlottersDrawingArea<'a> { /* fields omitted */ }
Expand description
An object that can be used as a drawing area by the plotters library.
This is needed because direct 2D needs to wrap the drawing command between a begin_draw
and end_draw
call
but it is impossible to do that within the DrawingBackend trait.
Implementations
Methods from Deref<Target = DrawingArea<&'a PlottersBackend, Shift>>
pub fn draw_mesh<DrawFunc, YH, XH>(
&self,
draw_func: DrawFunc,
y_count_max: YH,
x_count_max: XH
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
DrawFunc: FnMut(&mut DB, MeshLine<'_, X, Y>) -> Result<(), DrawingErrorKind<<DB as DrawingBackend>::ErrorType>>,
YH: KeyPointHint,
XH: KeyPointHint,
pub fn draw_mesh<DrawFunc, YH, XH>(
&self,
draw_func: DrawFunc,
y_count_max: YH,
x_count_max: XH
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
DrawFunc: FnMut(&mut DB, MeshLine<'_, X, Y>) -> Result<(), DrawingErrorKind<<DB as DrawingBackend>::ErrorType>>,
YH: KeyPointHint,
XH: KeyPointHint,
Draw the mesh on a area
Get the range of X of the guest coordinate for current drawing area
Get the range of Y of the guest coordinate for current drawing area
Get the left upper conner of this area in the drawing backend
Strip the applied coordinate specification and returns a shift-based drawing area
Compute the relative size based on the drawing area’s height
Compute the relative size based on the drawing area’s width
pub fn fill<ColorType>(
&self,
color: &ColorType
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
ColorType: Color,
pub fn fill<ColorType>(
&self,
color: &ColorType
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
ColorType: Color,
Fill the entire drawing area with a color
pub fn draw_pixel<ColorType>(
&self,
pos: <CT as CoordTranslate>::From,
color: &ColorType
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
ColorType: Color,
pub fn draw_pixel<ColorType>(
&self,
pos: <CT as CoordTranslate>::From,
color: &ColorType
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
ColorType: Color,
Draw a single pixel
Present all the pending changes to the backend
pub fn draw<'a, E, B>(
&self,
element: &'a E
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
E: Drawable<DB, B>,
B: CoordMapper,
&'a E: PointCollection<'a, <CT as CoordTranslate>::From, B>,
pub fn draw<'a, E, B>(
&self,
element: &'a E
) -> Result<(), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
E: Drawable<DB, B>,
B: CoordMapper,
&'a E: PointCollection<'a, <CT as CoordTranslate>::From, B>,
Draw an high-level element
Map coordinate to the backend coordinate
pub fn estimate_text_size(
&self,
text: &str,
style: &TextStyle<'_>
) -> Result<(u32, u32), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>>
pub fn estimate_text_size(
&self,
text: &str,
style: &TextStyle<'_>
) -> Result<(u32, u32), DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>>
Estimate the dimension of the text if drawn on this drawing area. We can’t get this directly from the font, since the drawing backend may or may not follows the font configuration. In terminal, the font family will be dropped. So the size of the text is drawing area related.
text
: The text we want to estimatefont
: The font spec in which we want to draw the text- return: The size of the text if drawn on this area
pub fn apply_coord_spec<CT>(&self, coord_spec: CT) -> DrawingArea<DB, CT> where
CT: CoordTranslate,
pub fn apply_coord_spec<CT>(&self, coord_spec: CT) -> DrawingArea<DB, CT> where
CT: CoordTranslate,
Apply a new coord transformation object and returns a new drawing area
Create a margin for the given drawing area and returns the new drawing area
pub fn split_vertically<S>(
&self,
y: S
) -> (DrawingArea<DB, Shift>, DrawingArea<DB, Shift>) where
S: SizeDesc,
pub fn split_vertically<S>(
&self,
y: S
) -> (DrawingArea<DB, Shift>, DrawingArea<DB, Shift>) where
S: SizeDesc,
Split the drawing area vertically
pub fn split_horizontally<S>(
&self,
x: S
) -> (DrawingArea<DB, Shift>, DrawingArea<DB, Shift>) where
S: SizeDesc,
pub fn split_horizontally<S>(
&self,
x: S
) -> (DrawingArea<DB, Shift>, DrawingArea<DB, Shift>) where
S: SizeDesc,
Split the drawing area horizontally
Split the drawing area evenly
Split the drawing area into a grid with specified breakpoints on both X axis and Y axis
pub fn titled<'a, S>(
&self,
text: &str,
style: S
) -> Result<DrawingArea<DB, Shift>, DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
S: Into<TextStyle<'a>>,
pub fn titled<'a, S>(
&self,
text: &str,
style: S
) -> Result<DrawingArea<DB, Shift>, DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>> where
S: Into<TextStyle<'a>>,
Draw a title of the drawing area and return the remaining drawing area
Trait Implementations
type Target = DrawingArea<&'a PlottersBackend, Shift>
type Target = DrawingArea<&'a PlottersBackend, Shift>
The resulting type after dereferencing.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PlottersDrawingArea<'a>
impl<'a> !Send for PlottersDrawingArea<'a>
impl<'a> !Sync for PlottersDrawingArea<'a>
impl<'a> Unpin for PlottersDrawingArea<'a>
impl<'a> !UnwindSafe for PlottersDrawingArea<'a>