ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 MIO.ExecuteOpenDialog: MultiSelect parameter

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Jan 18 2023 : 14:52:44
When I select multiple multi-frame images (e.g. TIFF) in the MIO.ExecuteOpenDialog:

var filename := ImageEnMViewMultiImages.MIO.ExecuteOpenDialog(
    'Select Multi-Frame Images',  // Title
    -1,                           // DefaultFilter
    -1,                           // Limit To FileType
    True,                         // Always Animate
    True,                         // MultiSelect !!!
    iesfMultiImagesOnly);         // ShowFormats

  if filename <> '' then
  begin
    // ERROR if multiple files are selected:
    ImageEnMViewMultiImages.MIO.LoadFromFile(filename);
  end;


If MultiSelect = True in MIO.ExecuteOpenDialog, the multiple files are separated by a '|' character. Do I have to separate these files manually, or is there a built-in method to AUTOMATICALLY load all the multiple selected files in the ImageEnMViewMultiImages control?
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 19 2023 : 13:50:03
Hi Peter

Your code looks correct, and should be reliable.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Jan 19 2023 : 03:26:23
Meanwhile, I use this workaround:

function OccurrencesOfChar(const S: string; const C: Char): Integer;
begin
  Result := 0;
  for var i := 1 to Length(S) do
  begin
    if S[i] = C then
      Inc(Result);
  end;
end;

var LoadedFilesCount := OccurrencesOfChar(filenames, #124) + 1;
CodeSite.Send('LoadedFilesCount', LoadedFilesCount);


Is this reliable and correct?
PeterPanino Posted - Jan 19 2023 : 03:10:50
Hi Nigel,

Thanks for the information. As LoadFromFiles can be used for any number of loaded files (both single files and multiple files), is there also a built-in method to get the NUMBER OF LOADED FILES?
xequte Posted - Jan 18 2023 : 23:01:51
Hi Peter

Please use LoadFromFiles:

// Execute the open dialog and load the returned list of selected files
filenames := ImageEnMView1.MIO.ExecuteOpenDialog('', '', true, 1, '', true);
ImageEnMView1.MIO.LoadFromFiles(filenames);


Nigel
Xequte Software
www.imageen.com