I present the calculation of the \pi+\gamma\to \pi+\pi0 transition amplitude from quantum chromodynamics. The amplitude is determined for a range of values of the photon virtuality [up to Q^2=1 GeV^2] and the final state energy. One observes a clear dynamical enhancement due to the presence of the \rho-resonance. By fitting the transition amplitude and analytically continuing it onto the \rho-pole, the \rho \to \pi\gamma form factor is obtained. This exploratory calculation, performed using lattice quantum chromodynamics, constitutes the very first determination of an electromagetic production/decay of a hadronic resonance directly from the fundamental theory of quarks and gluons. I highlight some of the necessary steps that made this calculation possible, and I discuss the status and outlook of the field for the study of N\gamma \to N* \to N\pi/N\pi\pi transitions.