Leadtools.Web Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
Add Method
See Also  Example
Leadtools.Web.Controls Namespace > WebThumbnailViewer Class : Add Method




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.
Adds a new thumbnail element(s) from an image to the end of the WebThumbnailsViewer control.

Syntax

Visual Basic (Declaration) 
Public Sub Add( _
   ByVal imageUrl As String, _
   ByVal firstPage As Integer, _
   ByVal lastPage As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As WebThumbnailViewer
Dim imageUrl As String
Dim firstPage As Integer
Dim lastPage As Integer
 
instance.Add(imageUrl, firstPage, lastPage)
C# 
public void Add( 
   string imageUrl,
   int firstPage,
   int lastPage
)
Managed Extensions for C++ 
public: void Add( 
   string* imageUrl,
   int firstPage,
   int lastPage
) 
C++/CLI 
public:
void Add( 
   String^ imageUrl,
   int firstPage,
   int lastPage
) 

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 BasicCopy 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