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





In This Topic
CropBlackBordersEx(Int32) Method
In This Topic
Detects and sets to White, margins consisting of black color around a GdPicture image. This method does not have the same behavior as the CropBlackBorders() method: The black borders are not removed but are set to blank. Therefore, the image dimensions are kept the same.
Syntax
'Declaration
 
Public Overloads Function CropBlackBordersEx( _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus CropBlackBordersEx( 
   int ImageID
)
public function CropBlackBordersEx( 
    ImageID: Integer
): GdPictureStatus; 
public function CropBlackBordersEx( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus CropBlackBordersEx( 
   int ImageID
) 
public:
GdPictureStatus CropBlackBordersEx( 
   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
Whitening the black margins on 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 set to white the black margins using the default confidence level.
    gdpictureImaging.CropBlackBordersEx(imageID);
    
    gdpictureImaging.SaveAsTIFF(imageID, "image.tif", TiffCompression.TiffCompressionCCITT4);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also