Page number to use if Image has more than one page (frame).
public int PageNumber { get; set; }
public:
property int PageNumber
{
int get()
void set(int value)
}
The 1-based page number to use by this item of Image has more than one page. Default value is 0.
This value is used as the 1-based page number when a valid object is set in the Image property. RasterImage supports multipage images (frames) and the same value can be set in multiple items. Use PageNumber to control which page is used by the item.
Note that even through the default value of 0 is not a legal page number, the item will check and internally revert to using 1 (first page).
ImageViewerPagerInteractiveMode uses the value of this property to cycle through the pages of a multipage image in an item.
For more information, refer to Image Viewer Items.
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
public ImageViewerForm _form = new ImageViewerForm();
public ImageViewer _imageViewer;
public void ImageViewerPageNumberExample()
{
// Get the Form's ImageViewer control
_imageViewer = _form.ImageViewer;
if (_imageViewer.Items.Count > 0)
{
var item = _imageViewer.ActiveItem;
var image = item != null ? item.Image : null;
var pageCount = (image != null) ? image.PageCount : 1;
if (pageCount > 1)
{
var oldPageNumber = item.PageNumber;
var newPageNumber = oldPageNumber;
newPageNumber++;
newPageNumber = Math.Max(1, Math.Min(pageCount, newPageNumber));
if (newPageNumber != oldPageNumber)
{
item.PageNumber = newPageNumber;
}
}
else
{
var index = _imageViewer.Items.IndexOf(_imageViewer.ActiveItem);
index++;
if (index >= 0 && index < _imageViewer.Items.Count)
_imageViewer.ActiveItem = _imageViewer.Items[index];
}
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document