GraphicsContext
using System.Numerics;
using System.Runtime.CompilerServices;
namespace System.Drawing
{
[NullableContext(2)]
[Nullable(0)]
internal sealed class GraphicsContext : IDisposable
{
public int State { get; set; }
public Vector2 TransformOffset { get; set; }
public Region Clip { get; set; }
public GraphicsContext Next { get; set; }
public GraphicsContext Previous { get; set; }
public bool IsCumulative { get; set; }
[NullableContext(1)]
public GraphicsContext(Graphics g)
{
TransformOffset = g.TransformElements.Translation;
Clip = g.GetRegionIfNotInfinite();
}
public void Dispose()
{
Next?.Dispose();
Next = null;
Clip?.Dispose();
Clip = null;
GC.SuppressFinalize(this);
}
}
}