- 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 System.IO.Path.DirectorySeparatorChar or System.IO.Path.AltDirectorySeparatorChar, nor can it contain any of the characters in System.IO.Path.InvalidPathChars.
- flags
- An RasterThumbnailBrowserLoadFlags enumeration that can be a combination of the following:
Value Description RasterThumbnailBrowserLoadFlags.None Default mode, the method will return immediatly and the thumbnails are loaded in a background thread. RasterThumbnailBrowserLoadFlags.Block The method will not return until all thumbnails are loaded. RasterThumbnailBrowserLoadFlags.OnlyValidImageFiles Only 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.
Visual Basic (Declaration) | |
---|---|
Overloads Public 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 System.IO.Path.DirectorySeparatorChar or System.IO.Path.AltDirectorySeparatorChar, nor can it contain any of the characters in System.IO.Path.InvalidPathChars.
- flags
- An RasterThumbnailBrowserLoadFlags enumeration that can be a combination of the following:
Value Description RasterThumbnailBrowserLoadFlags.None Default mode, the method will return immediatly and the thumbnails are loaded in a background thread. RasterThumbnailBrowserLoadFlags.Block The method will not return until all thumbnails are loaded. RasterThumbnailBrowserLoadFlags.OnlyValidImageFiles Only 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.
For an example, refer to RasterThumbnailBrowser.
Use the RasterThumbnailBrowser.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 Leadtools.Codecs.RasterCodecs.GetInformation(System.Uri,System.Boolean,System.Int32) 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 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.
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7