Top  Previous  Next

grabFile ( string File, integer Start, integer Frames [, integer Delay ] )

Use this function to acquire a single image or a sequence of images from the video device selected in ImageWarp and store them in files.

A string containing the template name for files in which captured images will be stored. In the single file mode, i.e., when the Frames parameter is set to zero, it is the name of the file to be created. In the multiple file mode, this name will be used as a prefix to which an ordinal index will be added. The image file format in which images will be stored is defined by the file extension.  
An integer specifying the index that will be assigned to the first image file captured in the multiple file mode. Index is the ordinal number added to the File template. For instance, if the file "C:\myimage.jpg" is specified, and Start =100, the images will be stored to files "C:\myimage00100.jpg", "C:\myimage00101.jpg", "C:\myimage00102.jpg", and so on. If Frames=0, the Start parameter is disregarded.  
A positive integer specifying the amount of video frames to be captured and stored in files. A value of zero indicates that the image should be captured into a single file.  
A positive integer specifying the delay (in milliseconds) between consecutive video frames to be captured and stored in files. If this parameter is omitted or if the video device frame rate is lower than the rate corresponding to the specified delay time, the function will use the fastest frame rate possible for the current video device adjusting the actual delay time accordingly.  
Error flags

The flag set if successful.  
The flag set if failed.  
The flag set if timeout occurred.  

The following operator will capture an image from the video device every five minutes and store the images in JPEG format in the folder "c:\archive\" under the names "photo1.jpg", "photo2.jpg"…"photo64.jpg":  
grabFile("c:\archive\photo.jpg", 1, 64, 5000)