DrawScope: Lines, Rects & Circles
Draw primitives onto the canvas.
Meet the Canvas
The Canvas Composable hands you a blank drawing surface. Inside it you paint pixels directly instead of stacking other Composables.
Canvas(modifier = Modifier.size(200.dp)) {
// drawing goes here
}Inside DrawScope
The lambda you pass to Canvas runs inside a DrawScope. That receiver gives you draw functions and the current size to work with.
All lessons in this course
- DrawScope: Lines, Rects & Circles
- Paths, Gradients & Blend Modes
- drawWithCache & Performance
- Build a Live Progress Ring