A simple numerical method allowing one to simulate the imaging process in the non-contact mode of the scanning force microscope in the case of a pyramidal tip interacting with a corrugated surface is presented. The attractive van der Waals and repulsive forces are described by a Lennard-Jones-type potential in order to study the image of nanostructures in the constant-height and constant-force-gradient modes. The influence of the tip's shape is demonstrated and the notion of resolution is discussed for both modes. We also analyse the consequences of the chemical natures of the nanostructures and the substrate for the image.