Imaging spectroscopy of solar microwave radiation. 1: Flaring emission