LEADTOOLS (Leadtools assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
TranslateColor(RasterImage,RasterColor) Method
See Also 
Leadtools Namespace > RasterImage Class > TranslateColor Method : TranslateColor(RasterImage,RasterColor) Method



destImage
Destination RasterImage object.
color
Value that specifies the color in the image to be translated.
destImage
Destination RasterImage object.
color
Value that specifies the color in the image to be translated.
Translates the specified color in the image, and returns the nearest matching color in the destination image. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Overloads Public Function TranslateColor( _
   ByVal destImage As RasterImage, _
   ByVal color As RasterColor _
) As RasterColor
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim destImage As RasterImage
Dim color As RasterColor
Dim value As RasterColor
 
value = instance.TranslateColor(destImage, color)
C# 
public RasterColor TranslateColor( 
   RasterImage destImage,
   RasterColor color
)
C++/CLI 
public:
RasterColor TranslateColor( 
   RasterImage^ destImage,
   RasterColor color
) 

Parameters

destImage
Destination RasterImage object.
color
Value that specifies the color in the image to be translated.

Return Value

The color value or the palette index of the nearest matching color in the destination image. If the destination image is 8 bits per pixel or less, this is always the palette index (The value of the RasterColor.IsPaletteIndex is true). Otherwise, it is the color value.

Example

For an example, refer to TransparentColor

Remarks

When creating a target image for animation, you can use this method to ensure that the correct color is specified as the background color.

The reverse of this method (to get a true RGB color value from a palette index color), use GetTrueColorValue.

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only), Windows Phone 7

See Also