Synchrotron x-ray imaging and stress measurements of diamond-anvil cell gaskets revealed large elastic strains at the diamond tip at a pressure of 300 gigapascals. The diamond, generally considered a rigid body, bent 16 degrees over a distance of 300 micrometers without failure. To complement these measurements, a technique was developed that permits x-ray diffraction to be measured through a beryllium gasket. Measurements on tungsten and iron revealed the strain anisotropy, deviatoric stress, and texture and showed that the yield strengths of these materials increase by up to two orders of magnitude at confining pressures of 200 to 300 gigapascals. The results allow identification of the maximum amount of strain accommodated by the anvil tips before failure. Further development of ultrahigh pressure techniques requires relieving stress concentrations associated with this large elastic deformation.