The elementary CuO2 plane sustaining cuprate high-temperature superconductivity occurs typically at the base of a periodic array of edge-sharing CuO5 pyramids (Fig 1a). Virtual transitions of electrons between adjacent planar Cu and O atoms, occurring at a rate $t/{hbar}$ and across the charge-transfer energy gap E, generate superexchange spin-spin interactions of energy $Japprox4t^4/E^3$ in an antiferromagnetic correlated-insulator state1. Hole doping the CuO2 plane disrupts this magnetic order while perhaps retaining superexchange interactions, thus motivating a hypothesis of spin-singlet electron-pair formation at energy scale J as the mechanism of high-temperature superconductivity. Although the response of the superconductors electron-pair wavefunction $Psiequiv<c_uparrow c_downarrow>$ to alterations in E should provide a direct test of such hypotheses, measurements have proven impracticable. Focus has turned instead to the distance ${delta}$ between each Cu atom and the O atom at the apex of its CuO5 pyramid. Varying ${delta}$ should alter the Coulomb potential at the planar Cu and O atoms, modifying E and thus J, and thereby controlling ${Psi}$ in a predictable manner. Here we implement atomic-scale imaging of E and ${Psi}$, both as a function of the periodic modulation in ${delta}$ that occurs naturally in $Bi_2Sr_2CaCu_2O_{8+x}$. We demonstrate that the responses of E and ${Psi}$ to varying ${delta}$, and crucially those of ${Psi}$ to the varying E, conform to theoretical predictions. These data provide direct atomic-scale verification that charge-transfer superexchange is key to the electron-pairing mechanism in the hole-doped cuprate superconductor ${Bi_2Sr_2CaCu_2O_{8+x}}$.