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

RegionScope

struct RegionScope
Helper to scope creating regions. Deletes the region when disposed.
public bool IsNull { get; }

Returns true if this represents a null HRGN.

public HRGN Region { get; }

public RegionScope(Rectangle rectangle)

Creates a region with the given rectangle via CreateRectRgn.

public RegionScope(int x1, int y1, int x2, int y2)

Creates a region with the given rectangle via CreateRectRgn.

public RegionScope(HDC hdc)

Creates a clipping region copy via GetClipRgn for the given device context.

public RegionScope(HRGN region)

Creates a region scope with the given HRGN.

public static HRGN op_Implicit(RegionScope regionScope)

public void Dispose()

public void RelinquishOwnership()

Clears the handle. Use this to hand over ownership to another entity.