Page number to use if Image has more than one page (frame).
public int PageNumber { get; set; } Public Property PageNumber() As IntegerGetSet
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 multi-page 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 multi-page image in an item.
For more information, refer to Image Viewer Items.
using Leadtools;using Leadtools.Controls;using Leadtools.Codecs;using Leadtools.Drawing;using LeadtoolsExamples.Common;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Color;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;if (_previousItem)newPageNumber--;elsenewPageNumber++;newPageNumber = Math.Max(1, Math.Min(pageCount, newPageNumber));if (newPageNumber != oldPageNumber){item.PageNumber = newPageNumber;}}else{var index = _imageViewer.Items.IndexOf(_imageViewer.ActiveItem);if (_previousItem)index--;elseindex++;if (index >= 0 && index < _imageViewer.Items.Count)_imageViewer.ActiveItem = _imageViewer.Items[index];}}
Imports LeadtoolsImports Leadtools.ControlsImports Leadtools.CodecsImports Leadtools.DrawingImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.ColorImports LeadtoolsControlsExamples.LeadtoolsExamples.CommonIf _imageViewer.Items.Count > 0 ThenDim item As ImageViewerItem = _imageViewer.ActiveItemDim image As RasterImageIf Not item Is Nothing Thenimage = item.ImageElseimage = NothingEnd IfDim pageCount As IntegerIf (Not image Is Nothing) ThenpageCount = image.PageCountElsepageCount = 1End IfIf pageCount > 1 ThenDim oldPageNumber As Integer = item.PageNumberDim newPageNumber As Integer = oldPageNumberIf _previousItem ThennewPageNumber -= 1ElsenewPageNumber += 1End IfnewPageNumber = Math.Max(1, Math.Min(pageCount, newPageNumber))If newPageNumber <> oldPageNumber Thenitem.PageNumber = newPageNumberEnd IfElseDim index As Integer = _imageViewer.Items.IndexOf(_imageViewer.ActiveItem)If _previousItem Thenindex -= 1Elseindex += 1End IfIf index >= 0 AndAlso index < _imageViewer.Items.Count Then_imageViewer.ActiveItem = _imageViewer.Items(index)End IfEnd IfEnd If
|
Products |
Support |
Feedback: PageNumber Property (ImageViewerItem) - Leadtools.Controls |
Introduction |
Help Version 19.0.2017.6.20
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.