<PackageReference Include="System.Drawing.Common" Version="9.0.5" />

BufferedGraphics

public sealed class BufferedGraphics : IDisposable
Provides a graphics buffer for double buffering.
public Graphics Graphics { get; }

Gets a Graphics object that outputs to the graphics buffer.

public void Dispose()

Releases all resources used by the BufferedGraphics object.

public void Render()

Writes the contents of the graphics buffer to the default device.

public void Render(Graphics target)

Writes the contents of the graphics buffer to the specified Graphics object.

public void Render(IntPtr targetDC)

Writes the contents of the graphics buffer to the device context associated with the specified IntPtr handle.