Size-scaling experiment in a two-dimensional electron gas using an inhomogeneous magnetic field due to a superconducting gate