Pinhole imaging of the neutron production in laser-driven inertial confinement fusion experiments can provide important information about performance of various capsule designs. In order to get good results in experiments, it is needed to judge performance of various pinhole designs qualitatively or quantitatively before experiment. Calculation of imaging can be simply separated into pinhole imaging and image spectral analysis. In this paper, pinhole imaging is discussed, codes for neutron pinhole imaging and image showing are programed. The codes can be used to provide theoretical foundation for pinhole designing and simulating data for image analysing.