capture preview function
capture preview function - javadoc