Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
LoadThumbnails(String,String,RasterThumbnailBrowserLoadFlags) Method
See Also 
Leadtools.WinForms Namespace > RasterThumbnailBrowser Class > LoadThumbnails Method : LoadThumbnails(String,String,RasterThumbnailBrowserLoadFlags) Method



path
The directory to browse.
searchPattern
The search string to match against the names of files in path. The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
flags
An RasterThumbnailBrowserLoadFlags enumeration that can be a combination of the following:
ValueDescription
RasterThumbnailBrowserLoadFlags.NoneDefault mode, the method will return immediatly and the thumbnails are loaded in a background thread.
RasterThumbnailBrowserLoadFlags.BlockThe method will not return until all thumbnails are loaded.
RasterThumbnailBrowserLoadFlags.OnlyValidImageFilesOnly valid image files are loaded. Any file that contains data not recognized by the RasterThumbnailBrowser.Codecs object as a valid image file will not be loaded.
Browses the specified directory for supported images, and generates thumbnails for each image file that is found.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub LoadThumbnails( _
   ByVal path As String, _
   ByVal searchPattern As String, _
   ByVal flags As RasterThumbnailBrowserLoadFlags _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterThumbnailBrowser
Dim path As String
Dim searchPattern As String
Dim flags As RasterThumbnailBrowserLoadFlags
 
instance.LoadThumbnails(path, searchPattern, flags)
C# 
public void LoadThumbnails( 
   string path,
   string searchPattern,
   RasterThumbnailBrowserLoadFlags flags
)
C++/CLI 
public:
void LoadThumbnails( 
   String^ path,
   String^ searchPattern,
   RasterThumbnailBrowserLoadFlags flags
) 

Parameters

path
The directory to browse.
searchPattern
The search string to match against the names of files in path. The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
flags
An RasterThumbnailBrowserLoadFlags enumeration that can be a combination of the following:
ValueDescription
RasterThumbnailBrowserLoadFlags.NoneDefault mode, the method will return immediatly and the thumbnails are loaded in a background thread.
RasterThumbnailBrowserLoadFlags.BlockThe method will not return until all thumbnails are loaded.
RasterThumbnailBrowserLoadFlags.OnlyValidImageFilesOnly valid image files are loaded. Any file that contains data not recognized by the RasterThumbnailBrowser.Codecs object as a valid image file will not be loaded.

Example

For an example, refer to RasterThumbnailBrowser.

Remarks

Use the LoadThumbnails method to populate the RasterThumbnailBrowser control with the thumbnails of image files found in the directory specified by path. The control will load the images in the following manner:

  • All items already in control are cleared.
  • The control will create an item for each file that matches searchPattern.
  • If RasterThumbnailBrowserLoadFlags.OnlyValidImageFiles is specified in flags, the control will use the GetInformation method of the RasterThumbnailBrowser.Codecs object to check if the given file contains a valid image or not. If it does not, no item will be created for this file.
  • The control fills the FileName property of the item with the name of the file found, Page will be set to 1, Text with file name and extension of the specified file and RasterImageListItem.Image with LoadingThumbnail. If RasterThumbnailBrowserLoadFlags.Block is specified in flags, the control will then continue to load the thumbnails for all items before returning. If RasterThumbnailBrowserLoadFlags.Block is not specified, the control will create a background thread to load the thumbnails for all the items and return control to the caller at this stage.
  • The control will raise the LoadThumbnail event for each item before it creates the thumbnail for it. You can use this event to update a progress bar, cancel the operation or load the thumbnail yourself.
  • If the non-blocking loading operation is specified, you can check the IsLoadingThumbnails at any time to determine whether the control has more items to load.
  • The FinishedLoadingThumbnails event is raised by the control when the thumbnails of all items have been created.
  • The CancelLoadingThumbnails method can be called at any time to abort creating the thumbnails of all items.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also