CropWhiteBorders(Int32,Single) Method
In This Topic
Detects and removes margins consisting of white color around a GdPicture image.
It has a Confidence Parameter where if the lines and borders detection confidence exceeds this value
they will be removed, and left as they are if the confidence in detecting them is less than the
Confidence Parameter Value.
Syntax
Parameters
- ImageID
- GdPicture image identifier.
- Confidence
- Confidence threshold in percentage. Default value is 99.
Return Value
A member of the GdPictureStatus enumeration.
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 custom confidence level.
gdpictureImaging.CropWhiteBorders(imageID, 99);
gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
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 custom confidence level.
gdpictureImaging.CropWhiteBorders(imageID, 99);
gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also