LBitmapList::GetCurrentIndex

Summary

Gets the current index for the bitmap list object.

Syntax

#include "ltwrappr.h"

L_UINT LBitmapList::GetCurrentIndex()

Returns

The current index for the bitmap list object.

Comments

The current index controls which item is returned when calling LBitmapList::GetNextItem and LBitmapList::GetPreviousItem.

Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.

Note: If the list is empty, this function will return 0.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapList__GetCurrentIndexExample(HWND hWnd) 
{ 
   L_INT nRet; 
   LBitmapList BitmapList; 
   LBitmapBase Bitmap; 
 
   L_TCHAR szDummyBuffer[50]; 
   L_UINT uCurrentIndex; 
 
   nRet =BitmapList.Create (); 
   if(nRet !=SUCCESS) 
      return nRet; 
   // load three images and insert them in the list 
   nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =BitmapList.InsertItem (&Bitmap); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image2.cmp")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =BitmapList.InsertItem (&Bitmap); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =BitmapList.InsertItem (&Bitmap); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   // Set list to second item 
   nRet =BitmapList.SetCurrentIndex(2); 
   if(nRet !=SUCCESS) 
      return nRet; 
   // get the current index 
   uCurrentIndex = BitmapList.GetCurrentIndex (); 
   wsprintf(szDummyBuffer, TEXT("This is item number %d in list."), uCurrentIndex); 
   MessageBox(hWnd, szDummyBuffer, TEXT("LBitmapList"), MB_OK); 
   // destroy bitmaplist 
   BitmapList.Destroy (); 
    
   return SUCCESS; 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.