Visual Basic (Declaration) | |
---|---|
Public Sub AddBorderToRegion( _ ByVal left As Integer, _ ByVal top As Integer, _ ByVal borderColor As RasterColor, _ ByVal lowerToleranceColor As RasterColor, _ ByVal upperToleranceColor As RasterColor, _ ByVal combineMode As RasterRegionCombineMode _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void AddBorderToRegion( int left, int top, RasterColor borderColor, RasterColor lowerToleranceColor, RasterColor upperToleranceColor, RasterRegionCombineMode combineMode ) |
C++/CLI | |
---|---|
public: void AddBorderToRegion( int left, int top, RasterColor borderColor, RasterColor lowerToleranceColor, RasterColor upperToleranceColor, RasterRegionCombineMode combineMode ) |
Parameters
- left
- X coordinate of a point. The color of the specified point will be used to set the region.
- top
- Y coordinate of a point. The color of the specified point will be used to set the region.
- borderColor
- Border color.
- lowerToleranceColor
- Lower tolerance values that set the lower stopping point for the region.
- upperToleranceColor
- Upper tolerance values that set the lower stopping point for the region.
- combineMode
- The action to take regarding the existing image region, if one is defined.
Visual Basic | Copy Code |
---|---|
Public Sub AddBorderToRegionExample() |
C# | Copy Code |
---|---|
public void AddBorderToRegionExample() |
For color bitmaps:
If the value of the pixel at (x, y) is (125, 125, 125) and lowerToleranceColor is (20,30,15), then the lower stopping point is (105, 95, 110). If upperToleranceColor is (20,30,15), then the upper stopping point is (145,155,140). In this case, the pixels with values between (105,95,110) and (145,155,140) are non-border pixels and will be included in the region. Any pixel with a value outside this range or equal to borderColor is considered a border pixel.
For gray scale bitmaps:
The minimum channel tolerance value of lowerToleranceColor will be used to set the lower stopping point, and the minimum channel tolerance value of upperToleranceColor will be used to set the upper stopping point. For example, if the value of the pixel at (x, y) is (125, 125, 125) and lowerToleranceColor is (20,30,15), the smallest value of the triplet (15) will be used to create the lower stopping point of (110,110,110). If upperToleranceColor is (10,25,20), the smallest value of that triplet (10) will be used to create the upper stopping point of (135,135,135). In this case, the pixels with values between (110, 110, 110) and (135,135,135) are non-border pixels and will be included in the region. Any pixel with a value outside this range or equal to borderColor is considered a border pixel.
This method does not support signed data images.
To update an existing region, you specify how the new region is to be combined with the existing one using the combineMode parameter. For more information, refer to RasterRegionCombineMode.
For more information, refer to Creating a Region.
For more information, refer to Saving A Region.
For more information, refer to Working with the Existing Region.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family