DeleteBlackBorders Method (GdPictureImaging)
 
            
                In This Topic
            
            
            Deletes black borders of a document image by replacing them with white content.
            
            
            
            Syntax
            
            
            
            
            'Declaration
 
Public Function DeleteBlackBorders( _
   ByVal  As Integer, _
   ByVal  As Integer, _
   ByVal  As Boolean _
) As GdPictureStatus
             
        
            
            public GdPictureStatus DeleteBlackBorders( 
   int ,
   int ,
   bool 
)
             
        
            
            public function DeleteBlackBorders( 
    : Integer;
    : Integer;
    : Boolean
): GdPictureStatus; 
             
        
            
            public function DeleteBlackBorders( 
    : int,
    : int,
    : boolean
) : GdPictureStatus;
             
        
            
            public: GdPictureStatus DeleteBlackBorders( 
   int ,
   int ,
   bool 
) 
             
        
            
            public:
GdPictureStatus DeleteBlackBorders( 
   int ,
   int ,
   bool 
) 
             
        
             
        
            Parameters
- ImageID
 
- GdPicture image identifier.
 - Margin
 
- Max distance in pixels from edges of image a border is allowed to start. Suggested value is 10.
 - SkewedBorders
 
- Whether the borders are skewed or not. Meaning if the borders are not uniform in size,
             such that their width changes along the y-axis if they are vertical borders,
             or their height changes along the x-axis if they are horizontal borders, or both. Suggested value is false.
 
            
            Return Value
            A member of the GdPictureStatus enumeration.
            
 
            
            
            
            
            
            Example
Deleting black borders 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);
 
    // Delete black borders from a skewed image by replacing them with white content.
    // The max distance in pixels from edges of an image where a border is allowed to start is 10 pixels.
    gdpictureImaging.DeleteBlackBorders(imageID, 10, true);
    
    gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
	 
	
 
 
            
            Example
Deleting black borders 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);
             
                // Delete black borders from a skewed image by replacing them with white content.
                // The max distance in pixels from edges of an image where a border is allowed to start is 10 pixels.
                gdpictureImaging.DeleteBlackBorders(imageID, 10, true);
                
                gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
                gdpictureImaging.ReleaseGdPictureImage(imageID);
            }
            
            
            
            See Also