LEADTOOLS Windows Forms (Leadtools.WinForms assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
FileTotalPages Property
See Also 
Leadtools.WinForms Namespace > RasterImageListItem Class : FileTotalPages Property



Gets the total number of pages a multi page file.

Syntax

Visual Basic (Declaration) 
Public Property FileTotalPages As Integer
Visual Basic (Usage)Copy Code
Dim instance As RasterImageListItem
Dim value As Integer
 
instance.FileTotalPages = value
 
value = instance.FileTotalPages
C# 
public int FileTotalPages {get; set;}
C++/CLI 
public:
property int FileTotalPages {
   int get();
   void set (    int value);
}

Property Value

The 1-based page number index in Image to display. Default value is 1.

Example

This example will create and populate a RasterImageList control with thumbnail of the pages in multi-page image file.

Visual BasicCopy Code
Public Sub RasterImageListItem_Page(ByVal imageList As RasterImageList)
      ' Initialize the RasterCodecs class
      Dim codecs As RasterCodecs = New RasterCodecs()
      ' Clear existing items
      imageList.Items.Clear()

      ' Load a multi-page file
      Dim fileName As String = Path.Combine(LEAD_VARS.ImagesDir, "eye.gif")
      Dim image As RasterImage = codecs.Load(fileName)

      ' Create the items (1 for each page)
      Dim page As Integer = 1
      Do While page <= image.PageCount
         Dim item As RasterImageListItem = New RasterImageListItem()

         item.Image = image ' Use the same image for all items
         item.Page = page ' But with a different page number
         item.Text = "Page " & page.ToString()

         ' Add the item to the image list
         imageList.Items.Add(item)
         page += 1
      Loop


   End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
C#Copy Code
public void RasterImageListItem_Page(RasterImageList imageList)
   {
      // Initialize the RasterCodecs class
      RasterCodecs codecs = new RasterCodecs();
      // Clear existing items
      imageList.Items.Clear();

      // Load a multi-page file
      string fileName = Path.Combine(LEAD_VARS.ImagesDir, "eye.gif");
      RasterImage image = codecs.Load(fileName);

      // Create the items (1 for each page)
      for (int page = 1; page <= image.PageCount; page++)
      {
         RasterImageListItem item = new RasterImageListItem();

         item.Image = image;  // Use the same image for all items
         item.Page = page;  // But with a different page number
         item.Text = "Page " + page.ToString();

         // Add the item to the image list
         imageList.Items.Add(item);
      }


   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}

Remarks

This property is valid only when calling RasterThumbnailBrowser.LoadThumbnails and the flags parameter is set to RasterThumbnailBrowserLoadFlags.ExpandMultiPage

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also