public class RasterCommandProcessorProgressEventArgs : EventArgs
public ref class RasterCommandProcessorProgressEventArgs : public System.EventArgs
class RasterCommandProcessorProgressEventArgs(EventArgs):
The Progress event occurs when a control is redrawn. A RasterCommandProcessorProgressEventArgs specifies information on which image and command is being currently processed.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
public void RasterCommandProcessorExample()
{
RasterCodecs codecs = new RasterCodecs();
string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "RasterCommandProcessor.tif");
// create a raster command processor
RasterCommandProcessor processor = new RasterCommandProcessor();
// add the commands (color-res to 8 then flip)
processor.Commands.Add(new ColorResolutionCommand(
ColorResolutionCommandMode.InPlace,
8,
RasterByteOrder.Rgb,
RasterDitheringMethod.None,
ColorResolutionCommandPaletteFlags.Optimized,
null));
processor.Commands.Add(new FlipCommand(false));
// load the images
const int imageCount = 4;
for (int i = 0; i < imageCount; i++)
{
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, string.Format("Image{0}.cmp", (i + 1) % 2 + 1));
processor.Images.Add(codecs.Load(srcFileName));
}
// run the commands
processor.Progress += new EventHandler<RasterCommandProcessorProgressEventArgs>(processor_Progress);
processor.Run();
processor.Progress -= new EventHandler<RasterCommandProcessorProgressEventArgs>(processor_Progress);
// save the result image as multi-page tif file
if (File.Exists(destFileName))
File.Delete(destFileName);
for (int i = 0; i < imageCount; i++)
codecs.Save(
processor.Images[i],
destFileName,
RasterImageFormat.Tif,
8,
1,
1,
-1,
CodecsSavePageMode.Append);
// clean up
for (int i = 0; i < imageCount; i++)
processor.Images[i].Dispose();
}
void processor_Progress(object sender, RasterCommandProcessorProgressEventArgs e)
{
// show information about the command
Console.Write("Running command {0} ({1}) of {2}, ", e.CommandNumber, e.Command, e.TotalCommands);
Console.Write("On image {0} ({1} by {2} pixels) of {3}, ", e.ImageNumber, e.Image.Width, e.Image.Height, e.TotalImages);
Console.WriteLine("{0}% done", e.Percent);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
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
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.