You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Crop, Auto Deskew & Auto Border Removal > CropBorders > CropBorders Method (Integer, Single, ReferencePoint, Integer, Integer, Integer, Integer)
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.CropBorders Method (Integer, Single, ReferencePoint, Integer, Integer, Integer, Integer)

Detects margins consisting of constant color around a GdPicture image. 

This function returns the coordinate of the cropping selection which can be used by the Crop function.

C#
public GdPictureStatus CropBorders(
    int ImageID, 
    Single Confidence, 
    ReferencePoint PixelReference, 
    ref int Left, 
    ref int Top, 
    ref int Width, 
    ref int Height
);
Visual Basic
Public Function CropBorders(
    ByVal ImageID As Integer, 
    ByVal Confidence As Single, 
    ByVal PixelReference As ReferencePoint, 
    ByRef Left As Integer, 
    ByRef Top As Integer, 
    ByRef Width As Integer, 
    ByRef Height As Integer
) As GdPictureStatus
Parameters
Parameters 
Description 
ImageID 
GdPicture Image Identifier.  
Confidence 
Confidence threshold in percentage. Default value is 90.  
PixelReference 
A member of the ReferencePoint enumeration. Default value is ReferencePoint.ReferencePointTopLeft.  
Left 
Returns the left coordinate, in pixel, of the area without margins.  
Top 
Returns the top coordinate, in pixel, of the area without margins.  
Width 
Returns the width, in pixel, of the area without margins.  
Height 
Returns the height, in pixel, of the area without margins.  
Returns

A member of the GdPictureStatus enumeration.

Detects & crops borders around an image

Dim Left, Top, Width, Height As Integer
 
Imaging1.CropBorders(ImageID, 90, ReferencePoint.ReferencePointTopLeft, Left, Top, Width, Height) 'Detect
Imaging1.Crop(ImageID, Left, Top, Width, Height) 'Crop
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.