Imaging ultrafast electronic motion by x-ray scattering