VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging Namespace / VintasoftImage Class / Crop Method
Rectangle to crop the image.
Example



In This Topic
    Crop Method (VintasoftImage)
    In This Topic
    Crops this image by the specified rectangle.
    Syntax
    'Declaration
     
    Public Sub Crop( _
       ByVal cropRect As Rectangle _
    ) 
    public void Crop( 
       Rectangle cropRect
    )
    public: void Crop( 
       Rectangle cropRect
    ) 
    public:
    void Crop( 
       Rectangle cropRect
    ) 

    Parameters

    cropRect
    Rectangle to crop the image.
    Remarks
    This method works synchronously, use the Vintasoft.Imaging.ImageProcessing.CropCommand if you need to crop image asynchronously with progress indicator.
    Example
    This example shows how to load image from disk, crop it and save to file.
    ' load image from file
    Using image As New Vintasoft.Imaging.VintasoftImage("c:\original-image.tif")
    	' crop image
    	image.Crop(New System.Drawing.Rectangle(100, 100, 300, 200))
    	' 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"))
    {
        // crop image
        image.Crop(new System.Drawing.Rectangle(100, 100, 300, 200));
        // 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