Leadtools.WinForms Namespace > RasterImageListItem Class : Page Property |
public int Page {get; set;}
'Declaration Public Property Page As Integer
'Usage Dim instance As RasterImageListItem Dim value As Integer instance.Page = value value = instance.Page
public int Page {get; set;}
get_Page();
set_Page(value);
Set up the RasterImageList control to an individual page of a multi-page file in each item. To do that, simply set the Image property of each item into the multi-page image, then set the Page property to the desired page.
The value of RasterImage.Page is not used to control the page number of the item to be viewed in this item. Instead, use the Page property. This allows the same Leadtools.RasterImage object to be used multiple items while setting the Page property to different values.
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
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"; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2