A visible and infrared dual-band detection technology based on shortwave HgCdTe material is presented. A short wave HgCdTe detector is used to implement visible imaging and short wave infrared imaging respectively by changing a visible lens and a short wave infrared lens. The results show that the short wave HgCdTe detector can used for visible light imaging. This makes it possible to develop a new kind of detector which can detect visible light and short wave infrared radiation simultaneously.