| Customize Help
| Save Settings


Function Map
Save a data buffer or container in a file, using a MIL output file format.
void MbufSave(
MIL_ID ContainerOrBufId //in

This function saves a previously allocated data buffer or container to a file, in a MIL file format.

If a container is specified, it is saved in the MIL native file format. This format stores all data and settings of the container and its components.

If a buffer is specified, it is saved in the MIL TIFF file format. This is a baseline TIFF 6.0 file format with extra information included in the comment field. The extra information includes the buffer attributes and data type.

The MIL TIFF file format supports images that are binary, grayscale, and RGB, as well as palette-color images. Images in a different format are internally converted before being saved. In addition, by default, most color image buffers are saved in a packed (chunky) format (in accordance with baseline TIFF 6.0 specifications). Color binary buffers are saved in a 1-bit per pixel format (data is stored in a 3-band, packed binary format).

When saving an image buffer (M_IMAGE), all the pixel information is stored in the file. In addition, if the image buffer includes any region of interest (ROI) information, set using MbufSetRegion(), the ROI information is also stored in the file.

When saving an image buffer (M_IMAGE) that has an associated LUT buffer (color palette), the content of the LUT is also saved with the image.

Note, you can perform the same operation as MbufSave(), using MbufExport() with its FileFormat parameter set to M_MIL_TIFF or M_MIL_NATIVE.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
This function is not supported on the selected boards.

Specifies the name and path of the file in which to save the file. It is recommended that you use the MIM file extension for buffers, and the MBUFC file extension for containers. The function handles (internally) the opening and closing of the file. If the file already exists, it will be overwritten.

This parameter can be set to one of the following values:

function map For specifying the file name and path
Click to summarizeValue Description
Click to summarize M_INTERACTIVE

Opens the File Save As dialog box from which you can interactively specify the drive, directory, and name of the file.

Click to summarize MIL_TEXT("FileName") 1

Specifies the drive, directory, and name of the file (for example, "C:\mydirectory\myfile"). Typically, data buffer files can contain any of the file extensions listed in MbufImport.

To specify a file on a remote computer (under Distributed MIL), prefix the specified file name string with "remote:///" (for example, "remote:///C:\mydirectory\myfile").

Click to summarize MIL_TEXT("ftp://user:password@server/pathtofile") 1

Save a data buffer on to a remote FTP server.

To access a remote FTP server anonymously, omit the user name and password.

FTPS is not supported.


1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().


Specifies the identifier of the data buffer or container to save. This image buffer can have an ROI set using MbufSetRegion().

Compilation information
Header Include mil.h.
Library Use mil.lib;.
DLL Requires mil.dll.