The encoding method has a considerable influence on the resolution, speed, and robustness of structured light measurement systems. A synthetic encoding method based on spatial and temporal encodings is presented. The method can achieve a spatial resolution of 231 codewords with only five projected images, which would require many more images if other binary codes were employed. The encoding and decoding processes are given, and experimental results verify the robustness and the reliability of the method. It is concluded that the combination of spatial and temporal information can further improve the efficiency of the encoding and make it more flexible in different applications of 3-D object profile measurement.