pub trait DrawScope {
// Required methods
fn size(&self) -> Size;
fn draw_content(&self);
fn draw_rect(&mut self, brush: Brush);
fn draw_rect_at(&mut self, rect: Rect, brush: Brush);
fn draw_round_rect(&mut self, brush: Brush, radii: CornerRadii);
fn draw_image(&mut self, image: ImageBitmap);
fn draw_image_at(
&mut self,
rect: Rect,
image: ImageBitmap,
alpha: f32,
color_filter: Option<ColorFilter>,
);
fn draw_image_src(
&mut self,
image: ImageBitmap,
src_rect: Rect,
dst_rect: Rect,
alpha: f32,
color_filter: Option<ColorFilter>,
);
fn into_primitives(self) -> Vec<DrawPrimitive>;
}Required Methods§
fn size(&self) -> Size
fn draw_content(&self)
fn draw_rect(&mut self, brush: Brush)
Sourcefn draw_rect_at(&mut self, rect: Rect, brush: Brush)
fn draw_rect_at(&mut self, rect: Rect, brush: Brush)
Draws a rectangle at the specified position and size.
fn draw_round_rect(&mut self, brush: Brush, radii: CornerRadii)
fn draw_image(&mut self, image: ImageBitmap)
fn draw_image_at( &mut self, rect: Rect, image: ImageBitmap, alpha: f32, color_filter: Option<ColorFilter>, )
Sourcefn draw_image_src(
&mut self,
image: ImageBitmap,
src_rect: Rect,
dst_rect: Rect,
alpha: f32,
color_filter: Option<ColorFilter>,
)
fn draw_image_src( &mut self, image: ImageBitmap, src_rect: Rect, dst_rect: Rect, alpha: f32, color_filter: Option<ColorFilter>, )
Draws a sub-region of an image. src_rect is in image-pixel
coordinates; dst_rect is in scope coordinates.