High-speed and high-resolution imaging of surface profiles is critical for the investigation of various structures and mechanical dynamics of micro- and nano-scale devices. In particular, recent emergence of various nonlinear, transient and complex mechanical dynamics, such as anharmonic vibrations in mechanical resonators, has necessitated real-time surface deformation imaging with higher axial and lateral resolutions, speed, and dynamic range. However, real-time capturing of fast and complex mechanical dynamics has been challenging, and direct time-domain imaging of displacements and mechanical motions has been a missing element in studying full-field structural and dynamic behaviours. Here, by exploiting the electro-optic sampling with a frequency comb, we demonstrate a line-scan time-of-flight (TOF) camera that can simultaneously measure the TOF changes of more than 1000 spatial coordinates with hundreds megapixels/s pixel-rate and sub-nanometre axial resolution over several millimetres field-of-view. This unique combination of performances enables fast and precise imaging of both complex structures and dynamics in three-dimensional devices and mechanical resonators.