| Customize Help
| Save Settings


Function Map
Load data from a file into a data buffer.
void MbufLoad(
MIL_ID BufId //in

This function loads data from a file into a previously allocated data buffer. The function detects the file format from the data.

Note, you can perform the same operation as MbufLoad() using MbufImport(), which uses the specified file format to open the file instead of trying to determine the format from the data.

If loading an image, all the pixel information in the file is loaded in the buffer. Additionally, if the file was saved in M_MIL_TIFF file format and includes any region of interest (ROI) information, the ROI information is also loaded in the buffer.

If the vectorial information of an M_VECTOR_AND_RASTER ROI was input in M_WORLD units, the ROI will be loaded as an M_VECTOR ROI.

[MIL-Lite with restriction]

When loading compressed data and the destination buffer has an M_IMAGE attribute (but not an M_COMPRESS attribute), this function will automatically decompress it. If necessary, the data in the file will be transformed to the format of the buffer. When loading uncompressed data into a buffer with an M_COMPRESS attribute, this function will automatically compress it, according to the compression settings found in the buffer.

When loading an image file that has been saved with an associated LUT (color palette) into a 3-band 8-bit image buffer, the LUT is automatically applied to the data to generate 3-band image data. In this case, a LUT buffer is not created and, therefore, is not associated with the 3-band 8-bit buffer. When loading an image file that has been saved with an associated LUT (color palette) into any other type of image buffer, the LUT is also imported and associated with the resulting image buffer. You can obtain the identifier of the associated LUT, using MbufInquire().

Note that the associated LUT will be automatically selected on the display (MdispLut()) if the image buffer is selected on a display and the default LUT has not been overidden by a former call to MdispLut().

Using MbufDiskInquire(), you can inquire about the dimensions of the data saved in a file (except for raw files) without loading it.

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 from which to load the data. The function handles (internally) the opening and closing of the file.

This parameter can be set to the following value:

function map For specifying the file name and path
Click to summarizeValue Description
Click to summarize MIL_TEXT("FileName") 1

Specifies the drive, directory, and name of the file, for example, "C:\mydirectory\myfile". Typically, data buffers have a MIM file extension.

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

Load data from a remote FTP server into a data buffer.

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

FTPS is not supported.

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

Load data from a remote HTTP server into a data buffer.

Import data from a remote HTTP server into a data buffer.

HTTPS 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 destination buffer. This buffer must be large enough in depth and dimensions to hold the data. If the data is deeper than the buffer, the most-significant bits of the data are truncated when loaded into the buffer. If the buffer depth is greater than that of the data, the data is zero or sign-extended (depending on the data type) when loaded into the buffer. If the buffer is larger in size than the data, exceeding areas of the buffer are unaffected.

  • [MIL-Lite]
    Note that during development and at runtime, compression support, particularly for an M_IMAGE + M_COMPRESS buffer type, requires the presence of a MIL license that grants access to the compression/decompression package. This access is only granted by default with the development license dongle for the full version of MIL. In other cases, you must purchase access to this package separately.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.