Add(string,int,int,string) Method

Summary

Adds a new thumbnail element from an image to the end of the WebThumbnailsViewer control and specify the thumbnail text.

Syntax
C#
VB
C++
public void Add( 
   string imageUrl, 
   int firstPage, 
   int lastPage, 
   string text 
) 
  
Public Overloads Sub Add( _ 
   ByVal imageUrl As String, _ 
   ByVal firstPage As Integer, _ 
   ByVal lastPage As Integer, _ 
   ByVal text As String _ 
)  
public: 
void Add(  
   String^ imageUrl, 
   int firstPage, 
   int lastPage, 
   String^ text 
)  

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.

text
The thumbnail item text.

Example

This example initializes the WebThumbnailViewer control and connect it to a WebImageViewer control, then loads some pages from "multipage.tif" file into it and set their text, then select the first thumbnail to display its image into the WebImageViewer control.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Web.Controls; 
 
public void WebThumbnailViewer_InitWebThumbnailViewerWithText(WebThumbnailViewer webThumbnailViewer, string webViewerID) 
{ 
   webThumbnailViewer.CacheFolder = "MyCacheFolderName"; 
   webThumbnailViewer.ResourcesPath = @"Resources"; 
   webThumbnailViewer.BrowserImageFormat = BrowserImageFormat.Jpeg; 
   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.ShowItemText = true; 
 
   webThumbnailViewer.Add(@"Resources\multipage.tif", 1, 1, "Page1"); 
   webThumbnailViewer.Add(@"Resources\multipage.tif", 1, 2, "Page2"); 
   webThumbnailViewer.SelectedIndex = 0; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.ImageProcessing 
Imports Leadtools.Web.Controls 
 
Public Sub WebThumbnailViewer_InitWebThumbnailViewerWithText(ByVal webThumbnailViewer As WebThumbnailViewer, ByVal webViewerID As String) 
   webThumbnailViewer.CacheFolder = "MyCacheFolderName" 
   webThumbnailViewer.ResourcesPath = "Resources" 
   webThumbnailViewer.BrowserImageFormat = BrowserImageFormat.Jpeg 
   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.ShowItemText = True 
 
   webThumbnailViewer.Add("Resources\multipage.tif", 1, 1, "Page1") 
   webThumbnailViewer.Add("Resources\multipage.tif", 1, 2, "Page2") 
   webThumbnailViewer.SelectedIndex = 0 
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Web Assembly