A new wavelength-dispersive X-ray fluorescence (WD-XRF) imaging spectrometer equipped with a two-dimensional X-ray detector was developed in the laboratory. Straight polycapillary optics was applied instead of a soller slit, which is used in conventional WD-XRF spectrometers. X-rays were guided through the straight polycapillary to the exit of the optics by X-ray external total reflections. X-ray fluorescence was dispersed by an analyzing crystal (LiF(200)), keeping the information of elemental distribution on the surface of the sample. The energy resolution of the developed spectrometer was 130-152 eV at the Zn Kα peak. X-ray elemental images of Cu Kα and Ni Kα were successfully obtained by an X-ray CCD detector at the corresponding diffraction angles. The analytical performance of this technique, and further improvements are discussed.