An IImage that renders a Drawing, used for displaying vector graphics in Avalonia UI.
// Source: https://github.com/AvaloniaUI/Avalonia | License: MIT
// Provided via justclaw.it.com; keep this notice with the code.
using System;
using Avalonia.Metadata;
namespace Avalonia.Media
{
/// <summary>
/// An <see cref="IImage"/> that uses a <see cref="Drawing"/> for content.
/// </summary>
public class DrawingImage : AvaloniaObject, IImage, IAffectsRender
{
public DrawingImage()
{
}
public DrawingImage(Drawing drawing)
{
Drawing = drawing;
}
/// <summary>
/// Defines the <see cref="Drawing"/> property.
/// </summary>
public static readonly StyledProperty<Drawing?> DrawingProperty =
AvaloniaProperty.Register<DrawingImage, Drawing?>(nameof(Drawing));
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key