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





In This Topic
CropBlackBorders(Int32) Method
In This Topic
Detects and removes margins consisting of black color around a GdPicture image.
Syntax
'Declaration
 
Public Overloads Function CropBlackBorders( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus CropBlackBorders( 
   int ImageID
)
public function CropBlackBorders( 
    ImageID: Integer
): GdPictureStatus; 
public function CropBlackBorders( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus CropBlackBorders( 
   int ImageID
) 
public:
GdPictureStatus CropBlackBorders( 
   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 black margins from a black and white tiff 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.tif", true);
 
    // Detect and remove the black margins using the default confidence level.
    gdpictureImaging.CropBlackBorders(imageID);
    
    gdpictureImaging.SaveAsTIFF(imageID, "image.tif", TiffCompression.TiffCompressionCCITT4);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also