Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
AddColorToRegion Method
See Also 
Leadtools Namespace > RasterImage Class : AddColorToRegion Method




color
Specifies the color to use for the region.
combineMode
The action to take regarding the existing image region, if one is defined.
Creates or updates the image region by adding a region that consists of all the pixels of a specified color.

Syntax

Visual Basic (Declaration) 
Public Sub AddColorToRegion( _
   ByVal color As RasterColor, _
   ByVal combineMode As RasterRegionCombineMode _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim color As RasterColor
Dim combineMode As RasterRegionCombineMode
 
instance.AddColorToRegion(color, combineMode)
C# 
public void AddColorToRegion( 
   RasterColor color,
   RasterRegionCombineMode combineMode
)
Managed Extensions for C++ 
public: void AddColorToRegion( 
   RasterColor color,
   RasterRegionCombineMode combineMode
) 
C++/CLI 
public:
void AddColorToRegion( 
   RasterColor color,
   RasterRegionCombineMode combineMode
) 

Parameters

color
Specifies the color to use for the region.
combineMode
The action to take regarding the existing image region, if one is defined.

Example

This example will load an image, adds a region all pixels of a specified color. It then fills the region with blue before saving it back to disk.

Remarks

You can use this method to simulate the use of a transparent color as follows:

  1. Call AddColorToRegion, with the transparent color in the color parameter and RasterRegionCombineMode.SetNot in the combineMode parameter.
  2. Call PaintRegion to paint the resulting region, which includes everything in the image, except the transparent color.

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.

This function does not support signed images.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also