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



Gets or sets a value that indicates whether the method will process the image.

Syntax

Visual Basic (Declaration) 
Public Property Flag As AutoColorLevelCommandFlags
Visual Basic (Usage)Copy Code
Dim instance As AutoColorLevelCommand
Dim value As AutoColorLevelCommandFlags
 
instance.Flag = value
 
value = instance.Flag
C# 
public AutoColorLevelCommandFlags Flag {get; set;}
C++/CLI 
public:
property AutoColorLevelCommandFlags Flag {
   AutoColorLevelCommandFlags get();
   void set (AutoColorLevelCommandFlags value);
}

Return Value

The method to process the image.

Example

Run the AutoColorLevelCommand on an image.

Visual BasicCopy Code
Public Sub FlagPropertyExample()
   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 AutoColorLevelCommand = New AutoColorLevelCommand(AutoColorLevelCommandType.Intensity, AutoColorLevelCommandFlags.None)
   command.Flag = AutoColorLevelCommandFlags.NoProcess
   command.Type = AutoColorLevelCommandType.Level

   ' Apply "Auto Leveling" to the image.
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

   MessageBox.Show("Master Leveling Value: " & Chr(13) & " Gamma: " & command.Master.Gamma & Chr(13) & _
      " Minimum Input: " & command.Master.MinimumInput & Chr(13) & _
      " Minimum Input: " & command.Master.MaximumInput & Chr(13) & _
      " Minimum Input: " & command.Master.MinimumOutput & Chr(13) & _
      " Minimum Input: " & command.Master.MaximumOutput)

   MessageBox.Show("Red Leveling Value: " & Chr(13) & " Gamma: " & command.Red.Gamma & Chr(13) & _
      " Minimum Input: " & command.Red.MinimumInput & Chr(13) & _
      " Minimum Input: " & command.Red.MaximumInput & Chr(13) & _
      " Minimum Input: " & command.Red.MinimumOutput & Chr(13) & _
      " Minimum Input: " & command.Red.MaximumOutput)

   MessageBox.Show("Green Leveling Value: " & Chr(13) & " Gamma: " & command.Green.Gamma & Chr(13) & _
      " Minimum Input: " & command.Green.MinimumInput & Chr(13) & _
      " Minimum Input: " & command.Green.MaximumInput & Chr(13) & _
      " Minimum Input: " & command.Green.MinimumOutput & Chr(13) & _
      " Minimum Input: " & command.Green.MaximumOutput)

   MessageBox.Show("Blue Leveling Value: " & Chr(13) & " Gamma: " & command.Blue.Gamma & Chr(13) & _
      " Minimum Input: " & command.Blue.MinimumInput & Chr(13) & _
      " Minimum Input: " & command.Blue.MaximumInput & Chr(13) & _
      " Minimum Input: " & command.Blue.MinimumOutput & Chr(13) & _
      " Minimum Input: " & command.Blue.MaximumOutput)

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

   // 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 
   AutoColorLevelCommand command = new AutoColorLevelCommand(); 
   command.Flag = AutoColorLevelCommandFlags.NoProcess; 
   command.Type = AutoColorLevelCommandType.Level; 
 
   // Apply "Auto Leveling" to the image. 
   command.Run(image); 
 
   MessageBox.Show("Master Leveling Value: \n Gamma: " + command.Master.Gamma + "\n" + 
      " Minimum Input: " + command.Master.MinimumInput + "\n" + 
      " Minimum Input: " + command.Master.MaximumInput + "\n" + 
      " Minimum Input: " + command.Master.MinimumOutput + "\n" + 
      " Minimum Input: " + command.Master.MaximumOutput); 
 
   MessageBox.Show("Red Leveling Value: \n Gamma: " + command.Red.Gamma + "\n" + 
      " Minimum Input: " + command.Red.MinimumInput + "\n" + 
      " Minimum Input: " + command.Red.MaximumInput + "\n" + 
      " Minimum Input: " + command.Red.MinimumOutput + "\n" + 
      " Minimum Input: " + command.Red.MaximumOutput); 
 
   MessageBox.Show("Green Leveling Value: \n Gamma: " + command.Green.Gamma + "\n" + 
      " Minimum Input: " + command.Green.MinimumInput + "\n" + 
      " Minimum Input: " + command.Green.MaximumInput + "\n" + 
      " Minimum Input: " + command.Green.MinimumOutput + "\n" + 
      " Minimum Input: " + command.Green.MaximumOutput); 
 
   MessageBox.Show("Blue Leveling Value: \n Gamma: " + command.Blue.Gamma + "\n" + 
      " Minimum Input: " + command.Blue.MinimumInput + "\n" + 
      " Minimum Input: " + command.Blue.MaximumInput + "\n" + 
      " Minimum Input: " + command.Blue.MinimumOutput + "\n" + 
      " Minimum Input: " + command.Blue.MaximumOutput); 
 
   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