Leadtools.ImageProcessing.Color Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ChangeHueSaturationIntensityCommand Class
See Also  Members   Example 



Changes the hue, saturation and brightness of all colors or specific colors in the image.

Object Model


Syntax

Visual Basic (Declaration) 
Public Class ChangeHueSaturationIntensityCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As ChangeHueSaturationIntensityCommand
C# 
public class ChangeHueSaturationIntensityCommand : RasterCommand, IRasterCommand  
C++/CLI 
public ref class ChangeHueSaturationIntensityCommand : public RasterCommand, IRasterCommand  

Example

Run the ChangeHueSaturationIntensityCommand on an image to change its hue, saturation, and brightness and change the red color to green.

Visual BasicCopy Code
Public Sub ChangeHueSaturationIntensityCommandExample()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   Dim command As ChangeHueSaturationIntensityCommand = New ChangeHueSaturationIntensityCommand
   Dim Data() As ChangeHueSaturationIntensityCommandData
   ReDim Data(0)

   Data(0) = New ChangeHueSaturationIntensityCommandData
   Data(0).Hue = 18000
   Data(0).Saturation = 0
   Data(0).Intensity = 0
   Data(0).OuterLow = 315
   Data(0).OuterHigh = 45
   Data(0).InnerLow = 345
   Data(0).InnerHigh = 15
   command.Data = Data
   command.Hue = 0
   command.Saturation = 0
   command.Intensity = 0

   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void ChangeHueSaturationIntensityCommandExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   // Prepare the command 
   ChangeHueSaturationIntensityCommand command    = new ChangeHueSaturationIntensityCommand(); 
   ChangeHueSaturationIntensityCommandData[] data = new ChangeHueSaturationIntensityCommandData[1]; 
   data[0]            = new ChangeHueSaturationIntensityCommandData(); 
   data[0].Hue        = 18000; 
   data[0].Saturation = 0; 
   data[0].Intensity  = 0; 
   data[0].OuterLow   = 315; 
   data[0].OuterHigh  = 45; 
   data[0].InnerLow   = 345; 
   data[0].InnerHigh  = 15; 
   command.Data       = data; 
   command.Hue        = 0; 
   command.Saturation = 0; 
   command.Intensity  = 0; 
 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
 
   RasterCodecs.Shutdown(); 
}

Remarks

For more information, refer to Changing Brightness and Contrast.
For more information, refer to Correcting Colors.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Color.ChangeHueSaturationIntensityCommand

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