  We present the first ab initio calculation of a radiative transition of a
hadronic resonance within quantum chromodynamics (QCD). We compute the
amplitude for $\pi\pi \to \pi\gamma^\star$, as a function of the energy of the
$\pi\pi$ pair and the virtuality of the photon, in the kinematic regime where
$\pi\pi$ couples strongly to the unstable $\rho$ resonance. This exploratory
calculation is performed using a lattice discretization of QCD with quark
masses corresponding to $m_\pi \approx 400$~MeV. We obtain a description of the
energy dependence of the transition amplitude, constrained at 48 kinematic
points, that we can analytically continue to the $\rho$ pole and identify from
its residue the $\rho \to \pi\gamma^\star$ form factor.
