C#
VB
C++
Gets the thumbnail text for a specific thumbnail element.
public string GetThumbnailText(int thumbIndex)
Public Function GetThumbnailText( _ByVal thumbIndex As Integer _) As String
public:String^ GetThumbnailText(int thumbIndex)
thumbIndex
The 0-based index of the thumbnail element about which to obtain its text.
The thumbnail element text.
This example get the image for the thumbnail element that have text same as targetThumbText.
using Leadtools;using Leadtools.Codecs;using Leadtools.Web.Controls;public RasterImage WebThumbnailViewer_GetThumbnailImageByText(WebThumbnailViewer webThumbnailViewer, string targetThumbText){RasterImage image = null;string thumbImageUrl = string.Empty;int pageIndex = 0;if (webThumbnailViewer.Count > 1){ThumbnailInfo thumbInfo;for (int i = 0; i < webThumbnailViewer.Count; i++){string currentThumbText = webThumbnailViewer.GetThumbnailText(i);if (currentThumbText == targetThumbText){thumbInfo = webThumbnailViewer.GetThumbnailInfo(i);thumbImageUrl = thumbInfo.Url;if (thumbInfo.CacheFileName != string.Empty)thumbImageUrl = thumbInfo.CacheFileName;pageIndex = thumbInfo.Page;break;}}if (thumbImageUrl != string.Empty){using (RasterCodecs codecs = new RasterCodecs()){string filePath = webThumbnailViewer.Page.MapPath(thumbImageUrl);image = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, pageIndex, pageIndex);}}}return image;}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.Web.Controls''' <!--Leadtools.Web.Controls.WebImageViewer.ImageUrl-->''' <!--Leadtools.Web.Controls.WebImageViewer.ImageUrl-->''' <!--Leadtools.Web.Controls.WebImageViewer.OpenImageUrl-->''' <!--Leadtools.Web.Controls.WebImageViewer.OpenImageUrl-->''' <!--Leadtools.Web.Controls.WebImageViewer.ScrollBarVisible-->''' <!--Leadtools.Web.Controls.WebImageViewer.ScrollBarVisible-->''' <!--Leadtools.Web.Controls.WebImageViewer.ApplyCommand-->''' <!--Leadtools.Web.Controls.WebImageViewer.ApplyCommand-->''' <!--Leadtools.Web.Controls.WebImageViewer.PropertyChanged-->''' <!--Leadtools.Web.Controls.WebImageViewer.PropertyChanged-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.AddWithText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.AddWithText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.InsertWithText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.InsertWithText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.EnsureVisible-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.EnsureVisible-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.GetThumbnailImageByText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.GetThumbnailImageByText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.SetThumbnailText-->''' <!--Leadtools.Web.Controls.WebThumbnailViewer.SetThumbnailText-->Public Function WebThumbnailViewer_GetThumbnailImageByText(ByVal webThumbnailViewer As WebThumbnailViewer, ByVal targetThumbText As String) As RasterImageDim image As RasterImage = NothingDim thumbImageUrl As String = String.EmptyDim pageIndex As Integer = 0If webThumbnailViewer.Count > 1 ThenDim thumbInfo As ThumbnailInfoFor i As Integer = 0 To webThumbnailViewer.Count Step 1Dim currentThumbText As String = webThumbnailViewer.GetThumbnailText(i)If currentThumbText = targetThumbText ThenthumbInfo = webThumbnailViewer.GetThumbnailInfo(i)thumbImageUrl = thumbInfo.UrlIf thumbInfo.CacheFileName <> String.Empty ThenthumbImageUrl = thumbInfo.CacheFileNameEnd IfpageIndex = thumbInfo.PageExit ForEnd IfNext iIf thumbImageUrl <> String.Empty ThenUsing codecs As RasterCodecs = New RasterCodecs()Dim filePath As String = webThumbnailViewer.Page.MapPath(thumbImageUrl)image = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, pageIndex, pageIndex)End UsingEnd IfEnd IfReturn imageEnd Function
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
