CONVERTIMAGETOGRID

CONVERTIMAGETOGRID Converts monochromatic image files (.BMP, .JPG, .TIFF, .PNG, etc) to .DAT files that can be used with the Grid Phase surface. For RGB images, the R channel is used for the conversion. Performs the Bitmap Image to OpticStudio DAT feature from within a macro.

Syntax:

CONVERTIMAGETOGRID filename, delta x, delta y, unit flag, offset x, offset y

Discussion:

The filename is the full path of the file to be converted. Delta x and delta y are the width and height between pixels in units specified by the unit flag. The unit flag is 0 for millimeters, 1 for centimeters, 2 for inches, and 3 for meters. Offset x and offset y may be used to decenter the image.

Example:

A$ = "C:\pictures\opticstudio.bmp"
CONVERTIMAGETOGRID A$, 0.1, 0.1, 0, 0, 0

Next: