Rendering Graphics
AlterNET UI incudes set of resolution-independent graphics features that use native rendering on every supported platform.
It supports rendering graphic primitives such as text, images, graphic shapes with different fonts, pens and brushes.
The following code example illustrates how graphics can be drawn in a UI element:
using Alternet.Drawing;
using Alternet.UI;
namespace DrawingContextTutorial
{
public class DrawingControl : Control
{
public DrawingControl()
{
UserPaint = true;
}
protected override void OnPaint(PaintEventArgs e)
{
e.DrawingContext.FillRectangle(Brushes.LightBlue, e.Bounds);
for (int size = 10; size < 200; size += 10)
e.DrawingContext.DrawEllipse(Pens.Red, new RectangleF(10, 10, size, size));
}
}
}
Refer to our blog post to see it in action.