←Select platform

PagePercent Property

Summary
Gets the load completion percentage of the current page.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public int PagePercent { get; } 
@property (nonatomic, assign, readonly) NSInteger pagePercent; 
public int getPagePercent() 
public: 
property int PagePercent { 
   int get(); 
} 
PagePercent # get  (CodecsLoadImageEventArgs) 

Property Value

A number between 0 and 100 that indicates the completion percentage of the load operation of the current page. The default value is 0.

Remarks

Using the PagePercent and TotalPercent properties, you can use the CodecsLoadImageEventArgs to show a progress bar of the current load operation.

When loading a multipage file, PagePercent will go from 0 to 100 for each page loaded while TotalPercent will go from 0 to 100 only once during the whole page operation. Usually, you will use TotalPercent to show an overall load progress if the multipage image is considered to be one document. If however, individual progress is required for each page, then you can track the PagePercent property as well.

When loading a single page file or one page from a multipage file, both PagePercent and TotalPercent will go from 0 to 100 simultaneously.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
private void Codecs_LoadImage(object sender, CodecsLoadImageEventArgs e) 
{ 
   e.Cancel = true; 
 
   // get all properties for the CodecsLoadImageEventArgs class. 
   Debug.WriteLine("File name is: {0}", e.FileName); 
   Debug.WriteLine("The Image width and height is: {0},{1}", e.Image.Width, e.Image.Height); 
   Debug.WriteLine("The Length of the buffer is: {0}", e.Buffer.Length); 
   Debug.WriteLine("The current row in the first line of the buffer is: {0}", e.Row); 
   Debug.WriteLine("The number of lines in the buffer is: {0}", e.Lines); 
 
   if (e.OffsetValid) 
   { 
      Debug.WriteLine("Offset count is : {0}", e.OffsetCount); 
      Debug.WriteLine("Offset value is : {0}", e.Offset); 
   } 
 
   if (e.TileValid) 
   { 
      LeadRect rect = e.Tile; 
      Debug.WriteLine("Tile Dimension ({0},{1},{2},{3)}", rect.X, rect.Y, rect.Width, rect.Height); 
   } 
 
   Debug.WriteLine("Image p number: {0}", e.ImagePage); 
   Debug.WriteLine("First page number: {0}", e.FirstPage); 
   Debug.WriteLine("Current page number: {0}", e.Page); 
   Debug.WriteLine("Last page number: {0}", e.LastPage); 
   Debug.WriteLine("Page percent: {0}%", e.PagePercent); 
   Debug.WriteLine("Total percent: {0}%", e.TotalPercent); 
   Debug.WriteLine("Flags = {0}", e.Flags); 
 
   System.IO.Stream loadStream = e.Stream; 
   CodecsImageInfo info = e.Info; 
   e.Cancel = false; 
} 
 
 
public void LoadImageExample() 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   codecs.LoadImage += new EventHandler<CodecsLoadImageEventArgs>(Codecs_LoadImage); 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")); 
   codecs.LoadImage -= new EventHandler<CodecsLoadImageEventArgs>(Codecs_LoadImage); 
 
   // Clean up 
   codecs.Dispose(); 
   image.Dispose(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.