VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.ImageProcessing.Info Namespace / GetBorderColorCommand Class
Members Example



In This Topic
    GetBorderColorCommand Class
    In This Topic
    Detects a border color of an image.
    Object Model
    GetBorderColorCommand ClassBorderColorInfo ClassBorderColorInfo ClassProcessingCommandResults ClassProcessingCommandResult ClassBorderColorInfo ClassBorderColorInfo Class
    Syntax
    'Declaration
     
    Public Class GetBorderColorCommand 
       Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    public class GetBorderColorCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public __gc class GetBorderColorCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public ref class GetBorderColorCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    Example
    This example shows how to load an image from disk and detect border color of the image.
    Class GetBorderColorCommandExample
        Public Sub ProcessImage()
            ' [ do not forget to set your image file path here! ]
            ' open an existing image
            Dim image As New Vintasoft.Imaging.VintasoftImage("Deskew.tif")
                
            ' create the command
            Dim command As New Vintasoft.Imaging.ImageProcessing.Info.GetBorderColorCommand()
                
            Try
                ' execute the command
                command.ExecuteInPlace(image)
            Catch ex As Vintasoft.Imaging.ImageProcessing.ImageProcessingException
                ' show error message if problem occured
                System.Windows.Forms.MessageBox.Show(ex.Message)
                Return
            End Try
                
            ' show result
            If command.IsBorderColorFound Then
                System.Windows.Forms.MessageBox.Show(String.Format("Border color is {0}.", command.BorderColor))
            Else
                System.Windows.Forms.MessageBox.Show("Border color is unknown.")
            End If
        End Sub
    End Class
    class GetBorderColorCommandExample
    {
        public void ProcessImage()
        {
            // [ do not forget to set your image file path here! ]
            // open an existing image
            Vintasoft.Imaging.VintasoftImage image = new Vintasoft.Imaging.VintasoftImage("Deskew.tif");
                
            // create the command
            Vintasoft.Imaging.ImageProcessing.Info.GetBorderColorCommand command =
                new Vintasoft.Imaging.ImageProcessing.Info.GetBorderColorCommand();
                
            try
            {
                // execute the command
                command.ExecuteInPlace(image);
            }
            catch (Vintasoft.Imaging.ImageProcessing.ImageProcessingException ex)
            {
                // show error message if problem occured
                System.Windows.Forms.MessageBox.Show(ex.Message);
                return;
            }
                
            // show result
            if (command.IsBorderColorFound)
            {
                System.Windows.Forms.MessageBox.Show(string.Format("Border color is {0}.", command.BorderColor));
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Border color is unknown.");
            }
        }
    }
    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
          Vintasoft.Imaging.ImageProcessing.Info.GetBorderColorCommand

    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also