We develop a theoretical method of calculating conductances in two-dimensional electron systems, where inhomogeneous magnetic fields are applied, based on the lattice Hamiltonian and nonequilibrium Green's function. The method is used for a magnetic quantum dot, which is formed by locally nonuniform magnetic fields. The calculated two-terminal conductance shows that the magnetic quantum dot behaves as a transmission barrier and as a resonator when the magnetic field inside the dot is parallel to that outside it.