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




destImage
Destination RasterImage object.
rgb
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.

Syntax

Visual Basic (Declaration) 
Public Function TranslateColor( _
   ByVal destImage As RasterImage, _
   ByVal rgb As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim destImage As RasterImage
Dim rgb As Integer
Dim value As Integer
 
value = instance.TranslateColor(destImage, rgb)
C# 
public int TranslateColor( 
   RasterImage destImage,
   int rgb
)
Managed Extensions for C++ 
public: int TranslateColor( 
   RasterImage* destImage,
   int rgb
) 
C++/CLI 
public:
int TranslateColor( 
   RasterImage^ destImage,
   int rgb
) 

Parameters

destImage
Destination RasterImage object.
rgb
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. Otherwise, it is the color value.

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.

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