We derive the dependence of the leading-twist pion light-cone distribution amplitude (LCDA) on a parton momentum fraction $x$ by directly solving the dispersion relations for the moments with inputs from the operator product expansion (OPE) of the corresponding correlation function. It is noticed that these dispersion relations must be organized into those for the Gegenbauer coefficients first in order to avoid the ill-posed problem appearing in the conversion from the moments to the Gegenbauer coefficients. Given the values of various condensates in the OPE, we find solutions for the pion LCDA, which are convergent and stable in the Gegenbauer expansion. Moreover, the solution from summing contributions up to 18 Gegenbauer polynomials is smooth, and can be well approximated by a function proportional to ${x}^{p}(1\ensuremath{-}x{)}^{p}$ with $p\ensuremath{\approx}0.45$ at the scale $\ensuremath{\mu}=2\text{ }\text{ }\mathrm{GeV}$. Turning off the condensates, we get the asymptotic form for the pion LCDA as expected. We then solve for the pion LCDA at a different scale $\ensuremath{\mu}=1.5\text{ }\text{ }\mathrm{GeV}$ with the condensate inputs at this $\ensuremath{\mu}$, and demonstrate that the result is consistent with the one obtained by evolving the Gegenbauer coefficients from $\ensuremath{\mu}=2\text{ }\text{ }\mathrm{GeV}$ to 1.5 GeV. That is, our formalism is compatible with the QCD evolution. The strength of the above framework that goes beyond analyses limited to only the first few moments of a LCDA in conventional QCD sum rules is highlighted. The precision of our results can be improved systematically by including higher-order and higher-power terms in the OPE.