VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging Namespace / VintasoftImage Class / ConvertToBlackWhite Method
Example



In This Topic
    ConvertToBlackWhite Method
    In This Topic
    Converts this image to the black-white image (1-bpp pixel format).
    Syntax
    'Declaration
     
    Public Sub ConvertToBlackWhite() 
    public void ConvertToBlackWhite()
    public: void ConvertToBlackWhite(); 
    public:
    void ConvertToBlackWhite(); 
    Remarks
    This method works synchronously, use the Vintasoft.Imaging.ImageProcessing.ChangePixelFormatCommand if you need to convert image asynchronously with progress indicator.
    Example
    This example shows how to load image from disk, convert it to black-white image and save to file.
    ' load image from file
    Using image As New Vintasoft.Imaging.VintasoftImage("c:\original-image.tif")
        ' convert image to black-white image
        image.ConvertToBlackWhite()
        ' save processed image to file
        image.Save("c:\processed-image.tif")
    End Using
    // load image from file
    using (Vintasoft.Imaging.VintasoftImage image =
        new Vintasoft.Imaging.VintasoftImage(@"c:\original-image.tif"))
    {
        // convert image to black-white image
        image.ConvertToBlackWhite();
        // save processed image to file
        image.Save(@"c:\processed-image.tif");
    }
    Requirements

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

    See Also