Adds a new thumbnail element(s) from an image to the end of the
WebThumbnailsViewer control.
Syntax
Parameters
- imageUrl
- The image URL or image virtual path to which to add its page(s) as thumbnail(s).
Each page will be added as a new thumbnail.
- firstPage
- The 1-based index of the first page to load.
- lastPage
- The 1-based index of the last page to load. Must be greater than or equal to firstPage.
You can pass -1 to load from firstPage to the last page in the file.
Example
This example initializes the WebThumbnailViewer control and connect it to a WebImageViewer control, then loads "multipage.tif" file into it, and select the first thumbnail to display its image into the WebImageViewer control.
Visual Basic | Copy Code |
---|
Public Sub WebThumbnailViewer_InitWebThumbnailViewer(ByVal webThumbnailViewer As WebThumbnailViewer, ByVal webViewerID As String)
webThumbnailViewer.CacheFolder = "MyCacheFolderName"
webThumbnailViewer.ResourcesPath = "Resources"
webThumbnailViewer.HorizontalAlignMode = ImageViewerAlignMode.Center
webThumbnailViewer.VerticalAlignMode = ImageViewerAlignMode.Center
webThumbnailViewer.LayoutDirection = LayoutDirection.Horizontal
webThumbnailViewer.ThumbStyle.BackColor = Color.LightGray
webThumbnailViewer.ThumbStyle.Cursor = "pointer"
webThumbnailViewer.ThumbStyle.HoverBackColor = Color.Gray
webThumbnailViewer.SelectedThumbStyle.BackColor = Color.Red
webThumbnailViewer.SelectedThumbStyle.Cursor = "default"
webThumbnailViewer.SelectedThumbStyle.HoverBackColor = Color.DarkRed
webThumbnailViewer.ThumbPadding = 10
webThumbnailViewer.ThumbSpacing = 10
webThumbnailViewer.ViewerID = webViewerID
webThumbnailViewer.ThumbSize = New Size(120, 120)
webThumbnailViewer.Add("Resources\multipage.tif", 1, -1)
webThumbnailViewer.SelectedIndex = 0
End Sub |
C# | Copy Code |
---|
public void WebThumbnailViewer_InitWebThumbnailViewer(WebThumbnailViewer webThumbnailViewer, string webViewerID) { webThumbnailViewer.CacheFolder = "MyCacheFolderName"; webThumbnailViewer.ResourcesPath = @"Resources"; webThumbnailViewer.HorizontalAlignMode = ImageViewerAlignMode.Center; webThumbnailViewer.VerticalAlignMode = ImageViewerAlignMode.Center; webThumbnailViewer.LayoutDirection = LayoutDirection.Horizontal; webThumbnailViewer.ThumbStyle.BackColor = Color.LightGray; webThumbnailViewer.ThumbStyle.Cursor = "pointer"; webThumbnailViewer.ThumbStyle.HoverBackColor = Color.Gray; webThumbnailViewer.SelectedThumbStyle.BackColor = Color.Red; webThumbnailViewer.SelectedThumbStyle.Cursor = "default"; webThumbnailViewer.SelectedThumbStyle.HoverBackColor = Color.DarkRed; webThumbnailViewer.ThumbPadding = 10; webThumbnailViewer.ThumbSpacing = 10; webThumbnailViewer.ViewerID = webViewerID; webThumbnailViewer.ThumbSize = new Size(120, 120); webThumbnailViewer.Add(@"Resources\multipage.tif", 1, -1); webThumbnailViewer.SelectedIndex = 0; } |
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