Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Saturday, August 26, 2006 5:37:59 PM(UTC)
congruentdesign

Groups: Registered
Posts: 4


I am using LeadTools v13 with the C++ classlib.  I would like to
allow the user to select multiple images which are then loades into an
imagelist.  I have no problem one image at a time but cannot enable multi-select.

1.  Does the classlib in v13 support muti-select on the file open?
2.  If so, how?
3. If not, does v14?

Thanks
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 28, 2006 10:47:05 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

This feature is supported in LEADTOOLS v13 and LEADTOOLS v14.5.

First of all, In the OPENFILENAME structure, you should pass the OFN_ALLOWMULTISELECT parameter to the Flags member of the OPENFILENAME structure to enable Multiselect feature in the Fileopen dialog, and then call the LDialog::SetOpenFileName method to set the
OPENFILENAME structure( LDialogFile::GetOpenFileNameParams in v14.5).

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Saturday, September 2, 2006 1:26:17 PM(UTC)
congruentdesign

Groups: Registered
Posts: 4


I tried that but I keep getting a return code of -10 from DoModalFileOpen when I select more
then one image from a folder.  Here is a section of the code:

void CImageBar::OnFileImgImport()
{
    LBitmapBase        mBitmap;
    FILEINFO        FileInfo;
    FILEOPENPARM    FOParm ;
    OPENFILENAME    OpenFileName;
   
L_UINT            uFlags = (DLG_FO_MULTIPAGE | DLG_FO_FILEINFO | DLG_FO_SHOWPREVIEW);

    int                rc;
    L_CHAR            szFileName[_MAX_PATH];
    L_CHAR            szPathName[_MAX_PATH];
 
    szFileName[0] = 0;
    szPathName[0] = 0;
    FileInfo.Flags = 0;

    mBitmap.Dialog()->GetFileOpenParameters(&FOParm) ;
    FOParm.pBitmap = mBitmap.GetHandle();
    FOParm.pFileInfo = &FileInfo;
    FOParm.bPreviewEnabled = TRUE;
    FOParm.pThumbnail = NULL;
    FOParm.bLoadRotated = FALSE ;
    FOParm.bLoadCompressed = FALSE;
    mBitmap.Dialog()->SetFileOpenParameters(&FOParm);

    ::ZeroMemory(&OpenFileName, sizeof(OPENFILENAME));
    OpenFileName.lStructSize       = sizeof(OPENFILENAME);
    OpenFileName.lpstrFilter       = szOpenFileFilter;
    OpenFileName.nFilterIndex      = 1;
    OpenFileName.lpstrFile         = szFileName;
    OpenFileName.nMaxFile          = _MAX_PATH;
    OpenFileName.lpstrFileTitle    = FOParm.szFileName;
    OpenFileName.nMaxFileTitle     = MAX_PATH;
    OpenFileName.lpstrInitialDir   = m_saveImportDir;
    OpenFileName.lpstrTitle        = "Import an Image";
    OpenFileName.lpstrDefExt       = NULL;
   
OpenFileName.Flags             = OFN_ALLOWMULTISELECT;

    mBitmap.Dialog()->SetOpenFileName(&OpenFileName);

     if ((rc = mBitmap.Dialog()->DoModalFileOpen(m_hWnd,uFlags)) == SUCCESS) {


 
#4 Posted : Monday, September 4, 2006 3:16:18 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

To resolve the problem try to pass NULL instead &FileInfo FOParm.pFileInfo parameter in your code. The code as follows:
+---------------------------------+
...
mBitmap.Dialog()->GetFileOpenParameters(&FOParm);
FOParm.pBitmap = mBitmap.GetHandle();
FOParm.pFileInfo = NULL;//&FileInfo;
FOParm.bPreviewEnabled = TRUE;
...
+---------------------------------+

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.066 seconds.