MIL_CONST_TEXT_PTR FileName, | //in |
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 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.
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.
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:
For specifying the file name and
path
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("FileName") 1 |
Specifies the drive, directory, and name of the file, for example, "C:\mydirectory\myfile". (more details...) |
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.
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |