We derive the magnetic transport-of-intensity equation (MTIE) that links defocused contrast of magnetic nanoobjects imaged by partially coherent electron waves to their micromagnetic parameters. This provides Maxwell's explanation for observable contrast in terms of the Z component of currents existing around vortices in superconductors and domain vortices and walls in ferromagnets. The solution of the MTIE via Fourier transform is used for quantitative mapping of magnetic flux and projected induction in magnetic and superconducting materials imaged by Lorentz microscopy.