// why is this a instance method ? and not static ? public void ReleaseHrgn(IntPtr regionHandle) { if (regionHandle == IntPtr.Zero) { throw new ArgumentNullException("regionHandle"); } Status status = Status.Ok; if (GDIPlus.RunningOnUnix()) { // for libgdiplus HRGN == GpRegion* status = GDIPlus.GdipDeleteRegion(regionHandle); } else { // ... but on Windows HRGN are (old) GDI objects if (!GDIPlus.DeleteObject(regionHandle)) { status = Status.InvalidParameter; } } GDIPlus.CheckStatus(status); }