#include "ltwrappr.h"
static L_INT LFileSettings::GetSaveResolution(puCount, pResolutions)
L_UINT * puCount; |
address of the count variable to be updated |
pDIMENSION pResolutions; |
pointer to the array to be updated |
Gets the information saved by the last LFileSettings::SetSaveResolution.
Parameter |
Description |
puCount |
Address of the puCount variable to be updated with the number of resolutions set by LFileSettings::SetSaveResolution. |
pResolutions |
Pointer to the array of DIMENSION structures to be updated with the physical resolutions set by the last call to LFileSettings::SetSaveResolution. You can pass NULL if you only want to get the number of resolutions. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Currently, this function only works with the JBIG format.
You must allocate the array to be updated. One way to do this is to declare an array of the maximum size (29 elements). Another way is to call this function twice the first time with NULL in the pResolutions parameter, so that you can get the number of elements and allocate storage of the appropriate size.
For JBIG files, only pResolutions[0].nWidth and pResolutions[0].nHeight are used when a save operation is performed. However, the exact values specified in the last call to LFileSettings::SetSaveResolution are returned.
Required DLLs and Libraries
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
Functions: |
|
Topics: |
|
|
Raster Image Functions: Getting and Setting File Information |
|
This example gets the dimensions set by the last call to LFileSettings::SetSaveResolution and displays them.
L_INT LFileSettings__GetSaveResolutionExample(){L_TCHAR szMessage[256]; // MessageBox stringL_UINT uCount; // variable to be updated with the number of resolutionspDIMENSION pDimensions=NULL;// Pointer to the array to be updatedHGLOBAL hDimensions=NULL; // Handle to the buffer for the arrayL_UINT i; // loop variableLFileSettings FileSet;L_INT nRet;// Count the number of dimensionsnRet = FileSet.GetSaveResolution (&uCount, NULL);if(nRet != SUCCESS)return nRet;if((uCount>0)){// Allocate memory to hold the array of DIMENSION structureshDimensions = GlobalAlloc(GMEM_MOVEABLE, sizeof(DIMENSION)* uCount);pDimensions = (pDIMENSION)GlobalLock( hDimensions );// Get the information saved by the last LFileSettings::SetSaveResolutionnRet = FileSet.GetSaveResolution(&uCount, pDimensions);}// Display a message box that shows the available sizes// In the case of JBIG only pDimensions[0].nWidth,// pDimensions[0].nHeight are validwsprintf (szMessage,TEXT("Available dimensions:\n"));for(i = 0; i < uCount; ++i){wsprintf (szMessage,TEXT("%s\n%d x %d"),szMessage,pDimensions[i].nWidth, pDimensions[i].nHeight);}::MessageBox( NULL,szMessage, TEXT("File Information"), MB_OK );if(hDimensions){// Free the memory that we allocatedGlobalUnlock (hDimensions);GlobalFree (hDimensions);}return SUCCESS;}
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
