A simple and fully automated technique for wavefront measurement is presented. This technique is based on the use of a computer display (for example, a CRT or a thin film transistor (TFT) monitor) to generate intensity-modulated patterns from which images are taken by a CCD camera. When a phase object is located between the display and the camera, the intensity patterns are distorted. By measuring this distortion, the gradients of the phase change caused by the object can be obtained. To simplify the data analysis it is practical to display on the monitor a grating with a sinusoidal intensity profile, which enables the use of standard fringe pattern analysis techniques. We use phase- shifting and temporal phase-unwrapping techniques. The use of a computer display for fringe (or grating) generation leads to the possibility of adjusting the sensibility of the measurement in function of the phase variation of the object to test and avoiding the problems of having a fixed grating period (as in the case of Ronchi rulings or printed gratings) or using mechanical parts to change them. Experimental measurements of two different ophthalmic lenses with local distributions of focal lengths prove the versatility of this method for optical testing. The method is simple, flexible, and low cost, yet it yields a remarkably high SNR. Compared with other techniques such as interferometry and moire deflecto- metry, the setup is cheaper and far easier to align.