Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.11.1
LEADTOOLS Raster Imaging C DLL Help

L_GetLoadStatus

Show in webframe

#include "l_bitmap.h"

L_LTFIL_API L_INT L_GetLoadStatus();

Detects whether the image that was last loaded has an error.

Returns

SUCCESS

The image loaded by the last load call does not have any errors.

ERROR_COMPRESSED_DATA_FAILURE

There were errors decoding the last image. The bottom part of the image might be corrupted.

ERROR_BAD_RESYNC_MARKER

Some of the resync markers were incorrect or missing while decoding the last image. Resync markers are used by JPEG files to recover from decoding errors. Portions of the image are corrupted. They are indicated by a checkerboard pattern.

ERROR_FILE_READ

The file was truncated. The bottom part of the image is missing.

ERROR_PDF_BAD_CONTENT

The file may not been loaded completely or it may have missing parts.

< 1

Another error occurred while loading the last image. Refer to Return Codes.

Comments

The returned error code describes a warning that portions of the image that was last loaded might be corrupted.

This function should be called after a load function returned SUCCESS. This value is reset after each page is loaded, so if you are loading multiple pages, this error code is valid only for the last page.

If the last load function returned an error code, then this function should not be used, as its return value is undefined.

Note that the return value is valid for the current thread. So L_GetLoadStatus should be called in the same thread as the load function.

This function is valid for all of the functions that will load a bitmap. Examples of such functions: L_LoadBitmap, L_LoadFile, L_LoadFileOffset, L_FeedLoad, etc.

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.

Platforms

Win32, x64, Linux.

See Also

Functions:

L_LoadFile, L_LoadBitmap, L_FeedLoad, L_LoadMemory, L_LoadFileOffset, L_LoadBitmapList, L_LoadFileTile, L_LoadMemoryTile

Topics:

Raster Image Functions: Loading Files

Loading and Saving Images

Example

This example will load an image and display a message box indicating whether the image has corrupted areas or not

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName


 L_INT LoadStatusExample(HWND hWnd)
{
   L_INT nRet;
   BITMAPHANDLE   Bitmap; 

   nRet = L_LoadBitmap(MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), &Bitmap, sizeof(BITMAPHANDLE), 24, ORDER_BGR, NULL, NULL); 
   if(nRet == SUCCESS) 
   {
      L_INT nLoadStatus = L_GetLoadStatus();
      if(nLoadStatus == SUCCESS) 
         MessageBox(hWnd, TEXT("The image was loaded successfully and with no errors"), TEXT("SUCCESS"), MB_OK); 
      else
         MessageBox(hWnd, TEXT("The image was loaded, but it might have corrupted areas"), TEXT("Warning!"), MB_OK); 
      if(Bitmap.Flags.Allocated)   
         L_FreeBitmap(&Bitmap); 
   }
   else
   {
      MessageBox(hWnd, TEXT("The load failed!"),TEXT("ERROR"), MB_OK); 
      return nRet;
   }
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.