Visual Basic (Declaration) | |
---|---|
Public Sub LoadThumbnails( _ ByVal path As String, _ ByVal searchPattern As String, _ ByVal flags As RasterThumbnailBrowserLoadFlags _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void LoadThumbnails( string path, string searchPattern, RasterThumbnailBrowserLoadFlags flags ) |
Managed Extensions for 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:
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 Codecs object as a valid image file will not be loaded.
For an example, refer to RasterThumbnailBrowser.
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 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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family