Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
FastMagicWandCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.Core Namespace : FastMagicWandCommand Class



Updates a region through the ObjectRectangle and the ObjectData variables according to the color value at Xposition and Yposition.

Syntax

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

Example

Runs the FastMagicWandCommand on the Image.

Visual BasicCopy Code
Public Sub FastMagicWandCommandExample()
     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 FastMagicWandCommand = New FastMagicWandCommand
     'Apply
     command.Tolerance = 50
     command.X = 100
     command.Y = 150
     command.SourceImage = leadImage
     command.StartEngine()
     command.Run(leadImage)
     command.EndEngine()

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

    // Load an image 
    RasterCodecs.Startup(); 
    RasterCodecs codecs = new RasterCodecs(); 
    codecs.ThrowExceptionsOnInvalidImages = true; 
 
    RasterImage image = codecs.Load("D:\\Lead15\\images2\\LEADTOOLS Images\\Master.jpg"); 
 
    // Prepare the command 
    FastMagicWandCommand command = new FastMagicWandCommand(); 
    //Apply  
 
 
    command.X = 50; 
    command.Y = 50; 
    command.Tolerance = 50; 
    command.SourceImage = image; 
 
    command.StartEngine(); 
    command.Run(image); 
    command.EndEngine(); 
 
    RasterCodecs.Shutdown(); 
}

Remarks

  • You can only run the command after the StartEngine function is called on the image.
  • You must call the EndEngine function after you run the command.
  • This command supports 1, 8, and 24-bit color images.
  • This command does not support 32-bit grayscale images.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Core.FastMagicWandCommand

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