GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / CropWhiteBorders Method / CropWhiteBorders(Int32) Method
GdPicture image identifier.
Example





CropWhiteBorders(Int32) Method
Detects and removes margins consisting of white color around a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function CropWhiteBorders( _
   ByVal ImageID As Integer _
) As GdPictureStatus
 

Parameters

ImageID
GdPicture image identifier.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method or an overload of it is used in the "Image Processing" Demo.
Example
Removing the white margins from a jpeg image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // LoadInMemory parameter is set to true in order to be able to update the input file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", true);
 
    // Detect and remove the white margins using the default confidence level.
    gdpictureImaging.CropWhiteBorders(imageID);
    
    gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also