Leadtools.ImageProcessing.Color Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
HistogramCommand Constructor(HistogramCommandFlags)
See Also  Example




channel
Flags that indicate the channel for which to get the histogram and the bits to use in calculating the histogram.
Initializes a new HistogramCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal channel As HistogramCommandFlags _
)
Visual Basic (Usage)Copy Code
Dim channel As HistogramCommandFlags
 
Dim instance As HistogramCommand(channel)
C# 
public HistogramCommand( 
   HistogramCommandFlags channel
)
Managed Extensions for C++ 
public: HistogramCommand( 
   HistogramCommandFlags channel
)
C++/CLI 
public:
HistogramCommand( 
   HistogramCommandFlags channel
)

Parameters

channel
Flags that indicate the channel for which to get the histogram and the bits to use in calculating the histogram.

Example

Visual BasicCopy Code
ImageProcessing.Color.HistogramCommand.HistogramConstructor
   Public Sub HistogramConstructorExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")

      ' Prepare the command
      Dim command As HistogramCommand = New HistogramCommand(HistogramCommandFlags.Red Or HistogramCommandFlags.AllBits)
      command.Run(leadImage)
      codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)
      'This is where the histogram information strored
      Dim histogramValues() As Integer = command.Histogram

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Color.HistogramCommand.HistogramConstructor 
      public void HistogramConstructorExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); 
 
         // Prepare the command 
         HistogramCommand command = new HistogramCommand(HistogramCommandFlags.Red | HistogramCommandFlags.AllBits); 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
         //This is where the histogram information strored 
         int [] histogramValues = command.Histogram; 
 
         RasterCodecs.Shutdown(); 
      }

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also