(Thumbnail Continued from page 2)

The user can set options for appearance and functionality. For example, the following figure (Figure 3) shows the supported selection options.

The Thumbnail control is an important tool for visual applications, for browsing images in a directory, for searching, or to manage a large number of images in a directory.

A future version of the thumbnail control will contain lower level service calls such as recursive browsing (that searches subdirectories too).
 

 

 

The following is a C++ sample code display of the thumbnail browser dialog window, and it handles the paths of selected images. Users must include BiThumbnail.h and use BiThumbnail.lib and BiThumbnail.dll. The Thumbnail control comes with sample code for several languages such as VB, VB.NET, C#, J# and Delphi.
 

#include "BiThumbnail.h"


BiThumbnailDlg dlg(this);

// display dialog window
INT_PTR ret = dlg.DisplayThumbnailDlg();

// check error code
if(dlg.GetLastThumbnailError()){
CString str;
str.Format("Error code:%i\n%s",
dlg.GetLastThumbnailError(),
dlg.GetThumbnailErrorString().c_str());
AfxMessageBox(str);
}

if( ret == IDOK ){
// show selected image list
CString str;
int numOfItems = dlg.GetNumOfSelectedItems();
for(int i=0; i<numOfItems; ++i){
int buffSize = 255;
char strPath[255];
if(!dlg.GetSelectedItem(i, buffSize, strPath)){
CString strTmp(str);
str.Format("%s%s\n", strTmp, strPath);
}else{
AfxMessageBox(
"String buffer size is too small!");
}
}

AfxMessageBox(str);
}
 
Page 1 Page 2 Page 3