Leadtools.Web Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
Insert Method
See Also  Example
Leadtools.Web.Controls Namespace > WebThumbnailViewer Class : Insert 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.
thumbIndex
The 0-based index at which the new thumbnail element(s) should be inserted.
Inserts a new thumbnail element(s) from an image to the specified index of the WebThumbnailsViewer control.

Syntax

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

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.
thumbIndex
The 0-based index at which the new thumbnail element(s) should be inserted.

Example

This example initializes the replaces the first thumbnail with a "image1.jpg".

Visual BasicCopy Code
Public Sub WebThumbnailViewer_Insert(ByVal webThumbnailViewer As WebThumbnailViewer)
   '' Check if there is at least one thumbnail to replace.
   If (WebThumbnailViewer.Count > 1) Then
      '' Remove the first thumbnail image.
      WebThumbnailViewer.Remove(0, 0)
      ' insert a new image into as the first thumbnail.
      webThumbnailViewer.Insert("Resources\image1.jpg", 1, 1, 0)
   End If
End Sub
C#Copy Code
public void WebThumbnailViewer_Insert(WebThumbnailViewer webThumbnailViewer) 

   // Check if there is at least one thumbnail to replace. 
   if(webThumbnailViewer.Count > 1) 
   { 
      // Remove the first thumbnail image. 
      webThumbnailViewer.Remove(0, 0); 
      // insert a new image into as the first thumbnail. 
      webThumbnailViewer.Insert(@"Resources\image1.jpg", 1, 1, 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