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





In This Topic
CropWhiteBorders(Int32) Method
In This Topic
Detects and removes margins consisting of white color around a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function CropWhiteBorders( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus CropWhiteBorders( 
   int ImageID
)
public function CropWhiteBorders( 
    ImageID: Integer
): GdPictureStatus; 
public function CropWhiteBorders( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus CropWhiteBorders( 
   int ImageID
) 
public:
GdPictureStatus CropWhiteBorders( 
   int ImageID
) 

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