Radiative double-electron capture (RDEC), in which two-electron capture is accompanied by simultaneous emission of a single photon, was investigated for fully stripped and one-electron projectiles colliding with gaseous and thin-foil targets. RDEC can be considered the inverse of double photoionization by a single photon. For the gaseous targets, measurements were done for 2.11 MeV/u ${\mathrm{F}}^{9+}$ and ${\mathrm{F}}^{8+}$ ions interacting with ${\mathrm{N}}_{2}$ and Ne, while for the thin-foil target the measurements were done for 2.11 MeV/u ${\mathrm{F}}^{9+}$ and ${\mathrm{F}}^{8+}$ and 2.19 MeV/u ${\mathrm{O}}^{8+}$ and ${\mathrm{O}}^{7+}$ ions striking thin C targets. Reports on this work were already published separately in shorter accounts by La Mantia et al. [Phys. Rev. Lett. 124, 133401 (2020) for the gas targets and Phys. Rev. A 102, 060801(R) (2020) for the thin-foil targets]. The gas targets were studied under single-collision conditions, while the foil targets suffered unavoidable multiple collisions. The measurements were carried out by detecting x-ray emission from the target at ${90}^{\ensuremath{\circ}}$ to the beam direction in coincidence with outgoing ions undergoing double, single, and, in the case of the foil targets, no charge change inside the target. Striking differences between the gaseous and foil targets were found from these measurements, with RDEC for the gaseous targets occurring only in coincidence with q-2 outgoing projectiles as expected, while RDEC for the foil targets was seen in each of the outgoing q-2, q-1, and no charge-change states. The no charge-change result was totally unexpected. The cross sections for RDEC for the fully stripped ions on gas targets were found to be about six times larger than those for the one-electron projectiles. For the foil targets, the RDEC cross sections for the fully stripped and one-electron projectiles differ somewhat from one another but not to the the extent they did for the gas targets. In this work the cross sections for all of the projectiles for the foil targets were adjusted due to the target contaminant background from potassium and calcium atoms that existed in the spectra. Also, the cross sections for the incident one-electron projectiles were modified due to a correction for the fraction of these ions that becomes fully stripped in passage through the foil. These differences are attributed to the effects of the multiple collisions that occur for the foil targets. The differential cross sections at ${90}^{\ensuremath{\circ}}$ determined for each of the projectiles interacting with each of the targets are compared with each other and with the previous measurements. To the extent that the cross sections follow a ${sin}^{2}\ensuremath{\theta}$ dependence, the total cross sections are compared with theoretical calculations [E. A. Mistonova and O. Yu. Andreev, Phys. Rev. A 87, 034702 (2013)], for which the agreement is poor, with the measured cross section exceeding the predicted ones by about an order of magnitude. Possible reasons for this discrepancy will be discussed.