Adds a new thumbnail element(s) from an image to the end of the WebThumbnailsViewer control.
Public Overloads Sub Add( _
ByVal imageUrl As String, _
ByVal firstPage As Integer, _
ByVal lastPage As Integer _
)
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.
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.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Web.Controls;
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.BrowserImageFormat = BrowserImageFormat.Png;
// Enable loading the text files.
// inputProfile.xml Contains the following:
// <ImageGenerator>
// <InputProfile>
// <TxtEnabled>true</TxtEnabled>
// </InputProfile>
// </ImageGenerator>
webThumbnailViewer.InputProfile = webThumbnailViewer.Page.MapPath("Resources\\inputProfile.xml");
// Set the quality factor for images displayed by the thumbnail viewer, note that the BrowserImageFormat is set to Png.
// outputProfile.xml Contains the following:
// <ImageGenerator>
// <OutputProfile>
// <PngQualityFactor>9</PngQualityFactor>
// </OutputProfile>
// </ImageGenerator>
webThumbnailViewer.OutputProfile = webThumbnailViewer.Page.MapPath("Resources\\outputProfile.xml");
// Prevent the Internet Explorer from loading the thumbnail images in the Temporary Internet Folder.
webThumbnailViewer.DisableBrowserCaching = true;
webThumbnailViewer.Add(@"Resources\TextFile.txt", 1, -1);
webThumbnailViewer.SelectedIndex = 0;
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Web.Controls
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.BrowserImageFormat = BrowserImageFormat.Png
' Enable loading the text files.
' inputProfile.xml Contains the following:
' <ImageGenerator>
' <InputProfile>
' <TxtEnabled>true</TxtEnabled>
' </InputProfile>
' </ImageGenerator>
webThumbnailViewer.InputProfile = webThumbnailViewer.Page.MapPath("Resources\inputProfile.xml")
' Set the quality factor for images displayed by the thumbnail viewer, note that the BrowserImageFormat is set to Png.
' outputProfile.xml Contains the following:
' <ImageGenerator>
' <OutputProfile>
' <PngQualityFactor>9</PngQualityFactor>
' </OutputProfile>
' </ImageGenerator>
webThumbnailViewer.OutputProfile = webThumbnailViewer.Page.MapPath("Resources\outputProfile.xml")
' Prevent the Internet Explorer from loading the thumbnail images in the Temporary Internet Folder.
webThumbnailViewer.DisableBrowserCaching = True
webThumbnailViewer.Add("Resources\TextFile.txt", 1, -1)
webThumbnailViewer.SelectedIndex = 0
End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.