#include "stdafx.h" #include "BrowseFileDlg.h" MyFileBrowse::MyFileBrowse() { m_ImageCount = -1; } MyFileBrowse::~MyFileBrowse() { m_ImageCount = -1; } L_INT MyFileBrowse::BrowseDirCallBack( LBitmapBase L_FAR* pLBitmap, L_TCHAR L_FAR * pszFilename, pFILEINFO pInfo, L_INT nStatus, L_INT nPercent ) { if ( nStatus == SUCCESS ) { m_ImageCount++ ; if ( m_ImageCount >= DLG_IMAGE_LIST_COUNT ) { m_ImageCount-- ; return ERROR_USER_ABORT; } if ( ( pInfo->Width < pLBitmap->GetWidth() ) && ( pInfo->Height < pLBitmap->GetHeight() ) ) { LBitmapBase TmpBitmap; TmpBitmap.Load(pszFilename, 24, ORDER_BGR, NULL, NULL ) ; *m_pBitmapList->pBitmapList[m_ImageCount].pBitmap = *TmpBitmap.GetHandle(); TmpBitmap.SetHandle(0, false); } else { LBitmapBase TmpBitmap; TmpBitmap.Initialize(); TmpBitmap.Copy(*pLBitmap); *m_pBitmapList->pBitmapList[m_ImageCount].pBitmap = *TmpBitmap.GetHandle(); TmpBitmap.SetHandle(0,false); } if ( NULL != m_pBitmapList->pBitmapList [ m_ImageCount ].pszFileName ) { lstrcpy ( m_pBitmapList->pBitmapList [ m_ImageCount ].pszFileName, pszFilename ) ; } if ( NULL != m_pBitmapList->pBitmapList [ m_ImageCount ].pszDescription ) { lstrcpy ( m_pBitmapList->pBitmapList [ m_ImageCount ].pszDescription, pszFilename ) ; } } return SUCCESS; }