VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.ImageProcessing.Info Namespace / IsImageBlankCommand Class
Members Example



In This Topic
    IsImageBlankCommand Class
    In This Topic
    Checks whether an image is blank.
    Object Model
    IsImageBlankCommand ClassProcessingCommandResults ClassProcessingCommandResult Class
    Syntax
    'Declaration
     
    Public Class IsImageBlankCommand 
       Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    public class IsImageBlankCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public __gc class IsImageBlankCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    public ref class IsImageBlankCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase 
    Remarks
    Command analyzes the image pixels and collects information about colors used in image.
    Example
    This example shows how to load an image from disk and checks whether the image is blank.
    Class IsImageBlankCommandExample
    	Public Sub ProcessImage()
    		' [ do not forget to set your image file path here! ]
    		' open an existing image
    		Dim image As New Vintasoft.Imaging.VintasoftImage("BlankImage.tif")
                
    		' create the command
    		Dim command As New Vintasoft.Imaging.ImageProcessing.Info.IsImageBlankCommand()
                
    		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
    		System.Windows.Forms.MessageBox.Show(String.Format("Permitted noise level is {0}%, current noise level is {1}%", command.MaxNoiseLevel, command.NoiseLevel))
                
    		If command.Result Then
    			System.Windows.Forms.MessageBox.Show("Image is blank.")
    		Else
    			System.Windows.Forms.MessageBox.Show("Image is not blank.")
    		End If
    	End Sub
    End Class
    class IsImageBlankCommandExample
    {
        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("BlankImage.tif");
                
            // create the command
            Vintasoft.Imaging.ImageProcessing.Info.IsImageBlankCommand command =
                new Vintasoft.Imaging.ImageProcessing.Info.IsImageBlankCommand();
                
            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
            System.Windows.Forms.MessageBox.Show(string.Format("Permitted noise level is {0}%, current noise level is {1}%", command.MaxNoiseLevel, command.NoiseLevel));
                
            if (command.Result)
                System.Windows.Forms.MessageBox.Show("Image is blank.");
            else
                System.Windows.Forms.MessageBox.Show("Image is not blank.");
        }
    }
    Inheritance Hierarchy

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

    Requirements

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

    See Also