virtual L_INT LMemoryFile::GetInfo(LMemoryBuffer, pFileInfo, uStructSize, uFlags=FILEINFO_TOTALPAGES, pLoadFileOption=NULL)
Loads information about the file located in memory into a FILEINFO structure
A LEAD LBuffer object that holds the memory of the image file.
Pointer to the LEAD FILEINFO structure to be filled with data from the image file. You must set the uStructSize member of pFileInfo before calling LMemoryFile::GetInfo.
NOTE: Uninitialized pFileInfo should not pass to this function.
Size in bytes, of the structure pointed to by pFileInfo. Use sizeof(FILEINFO).
Flag indicating which members to update in the FILEINFO structure, if any. The FILEINFO_TOTALPAGES and FILEINFO_USEFILTERDATA values can be OR-ed together, in which case both values are retrieved. Possible values are:
Value | Meaning |
---|---|
FILEINFO_TOTALPAGES | [0x0001] Update the pFileInfo->TotalPages field with the total number of pages in the file. |
FILEINFO_USEFILTERDATA | [0x0002] Use filter data information to speed up loading. |
0 | Do not update the pFileInfo->TotalPages field. |
Pointer to optional extended load options. Pass NULL to use the default load options.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To use this function, do the following:
Declare a variable with the datatype of FILEINFO.
Load the file into memory and assign variables for the file's location in memory and for the file size.
If you are getting information about a multipage file (which can contain more than one image), use the LOADFILEOPTION structure to specify the page number. The information that you get will be for the image on the specified page.
Call the LMemoryFile::GetInfo function, passing the file name and the address of the FILEINFO variable as parameters. When calling the function, use the sizeof operator to pass the size of the FILEINFO structure in the uStructSize parameter.
Get the image information from the fields described in FILEINFO structure.
The parallelogram values retrieved by LMemoryFile::GetInfo may not be always correct because it depends on the memory file saved data. The function does not load file objects but reads the file dimensions which may be not saved within the memory file.
For a summary of file information functions, refer to Getting and Setting File Information.
Some file formats do not contain a well-defined file signature. This is especially true for document file formats (TXT, PST, etc). LEADTOOLS can still detect the file format using the filename extension (ex. ".PST"). However, when loading files from memory the filename extension is not available. To provide this function with a filename extension, set pFileInfo.Name to the image file's name with extension and pFileInfo.Flags to FILEINFO_NAMEVALID when loading from memory.
Notes:
More options are available in the LOADFILEOPTION structure.
This function does not support Kodak PhotoCD (PCD) files or Kodak FlashPix files.
The LMemoryBuffer parameter is passed by reference, and is a required parameter.
Note: You should never pass an uninitialized FILEINFO structure to this function.
Win32, x64.
For an example, refer to LMemoryFile::LoadMemory.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document