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




thumbIndex
The 0-based index of the thumbnail element about which to obtain information.
thumbIndex
The 0-based index of the thumbnail element about which to obtain information.
Gets information about a specific thumbnail element.

Syntax

Visual Basic (Declaration) 
Public Function GetThumbnailInfo( _
   ByVal thumbIndex As Integer _
) As ThumbnailInfo
Visual Basic (Usage)Copy Code
Dim instance As WebThumbnailViewer
Dim thumbIndex As Integer
Dim value As ThumbnailInfo
 
value = instance.GetThumbnailInfo(thumbIndex)
C# 
public ThumbnailInfo GetThumbnailInfo( 
   int thumbIndex
)
C++/CLI 
public:
ThumbnailInfo GetThumbnailInfo( 
   int thumbIndex
) 
JavaScript 
getThumbnailInfo(value: integer): Leadtools.Topics.ltwfThumbnailInfo ;

Parameters

thumbIndex
The 0-based index of the thumbnail element about which to obtain information.

Return Value

A ThumbnailInfo object containing information about the specified thumbnail element.

Example

This example loads the first thumbnail image into RasterImage.

Visual BasicCopy Code
Public Function WebImageViewer_GetThumbnailImage(ByVal webThumbnailViewer As WebThumbnailViewer) As RasterImage
   Dim image As RasterImage = Nothing
   If (webThumbnailViewer.Count > 1) Then
      Dim thumbInfo As ThumbnailInfo = webThumbnailViewer.GetThumbnailInfo(0)
      Dim thumbImageUrl As String = thumbInfo.Url

      If (Not thumbInfo.CacheFileName = String.Empty) Then
         thumbImageUrl = thumbInfo.CacheFileName
      End If
      Dim codecs As RasterCodecs = New RasterCodecs()

      Dim filePath As String = webThumbnailViewer.Page.MapPath(thumbImageUrl)

      image = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, thumbInfo.Page, thumbInfo.Page)
   End If
   Return image
End Function
C#Copy Code
public RasterImage WebImageViewer_GetThumbnailImage(WebThumbnailViewer webThumbnailViewer) 

   RasterImage image = null; 
   if(webThumbnailViewer.Count > 1) 
   { 
      ThumbnailInfo thumbInfo = webThumbnailViewer.GetThumbnailInfo(0); 
      string thumbImageUrl = thumbInfo.Url; 
 
      if(thumbInfo.CacheFileName != string.Empty) 
         thumbImageUrl = thumbInfo.CacheFileName; 
 
      RasterCodecs codecs = new RasterCodecs(); 
 
      string filePath = webThumbnailViewer.Page.MapPath(thumbImageUrl); 
 
      image = codecs.Load(filePath, 0, CodecsLoadByteOrder.BgrOrGray, thumbInfo.Page, thumbInfo.Page); 
   } 
   return image; 
}

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