Represents a collection of RasterCommands objects.
[DefaultMemberAttribute("Item")]public class RasterCommandsList : IList<RasterCommand>, ICollection<RasterCommand>, IEnumerable<RasterCommand>, IEnumerable
Public Class RasterCommandsListImplements System.Collections.Generic.IList(Of RasterCommand)
@interface LTRasterCommandsList : NSMutableArray<LTRasterCommand *> public class RasterCommandsList implements List<IRasterCommand> public ref class RasterCommandsList : System.Collections.Generic.IList<RasterCommand> using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Kernel;public void RasterCommandsListExample(){using (RasterCodecs codecs = new RasterCodecs()){// Load an imageusing (RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"))){//Prepare the listRasterCommandsList commandsList = new RasterCommandsList();commandsList.CommandCompleted += new EventHandler<RasterCommandCompletedEventArgs>(CommandCompleted);commandsList.Add(new Leadtools.ImageProcessing.Kernel.CropCommand(new LeadRect(100, 100, image.Width - 100, image.Height - 100)));commandsList.Add(new InvertCommand());// Run the command and save the resultcommandsList.Run(image);// Check the result image created, otherwise use the input imageif (commandsList.ResultImage != null){codecs.Save(commandsList.ResultImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.bmp"), RasterImageFormat.Bmp, 24);commandsList.ResultImage.Dispose();}else{codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.bmp"), RasterImageFormat.Bmp, 24);}}}}private void CommandCompleted(object sender, RasterCommandCompletedEventArgs e){Console.WriteLine(e.Command.ToString());}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.KernelPublic Sub RasterCommandsListExample()Using codecs As RasterCodecs = New RasterCodecs()Using image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"))' Prepare the listDim commandsList As RasterCommandsList = New RasterCommandsList()AddHandler commandsList.CommandCompleted, AddressOf CommandCompletedcommandsList.Add(New CropCommand(New LeadRect(100, 100, image.Width - 100, image.Height - 100)))commandsList.Add(New InvertCommand())' Run the command And save the resultcommandsList.Run(image)' Check the result image created, otherwise use the input imageIf commandsList.ResultImage IsNot Nothing Thencodecs.Save(commandsList.ResultImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.bmp"), RasterImageFormat.Bmp, 24)commandsList.ResultImage.Dispose()Elsecodecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.bmp"), RasterImageFormat.Bmp, 24)End IfEnd UsingEnd UsingEnd SubPrivate Sub CommandCompleted(ByVal sender As Object, ByVal e As RasterCommandCompletedEventArgs)Console.WriteLine(e.Command.ToString())End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"End Class
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
