This documentation provides a comprehensive guide to Maui Graphics APIs. It's designed for developers building applications using the Maui UI Toolkit. The core of Maui Graphics focuses on efficient rendering and visual fidelity.
Maui Graphics utilizes a layered approach: Canvas, Shader, and Geometry. The Canvas is the basic rendering surface. Shader nodes apply visual transformations to this surface.
Geometry is used to represent the 2D objects in the scene, offering more flexible control over their position and transformations.
Let's create a simple rectangle:
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'blue';
ctx.fillRect(50, 50, 100, 100);
ctx.fillStyle = 'white';
ctx.fillRect(200, 50, 100, 100);
Explore layering, transforms, and custom shaders for advanced visual effects.