<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.2.25163.9" />

CachedBitmap

public sealed class CachedBitmap : IDisposable
Represents a device-dependent copy of a Bitmap matching a specified Graphics object's current device (display) settings. Avoids reformatting step when rendering, which can significantly improve performance.
public CachedBitmap(Bitmap bitmap, Graphics graphics)

Creates a device-dependent copy of bitmap for the device settings of graphics.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.