←Select platform

TranslateColor(RasterImage,int) Method

Summary
Translates the specified color in the image, and returns the nearest matching color in the destination image.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public int TranslateColor( 
   RasterImage destImage, 
   int rgb 
) 
- (unsigned int)translateColorRgb:(LTRasterImage *)dstImage  
                              rgb:(unsigned int)rgb 
public int translateColor( 
   RasterImage destImage, 
   int rgb 
); 
public: 
int TranslateColor(  
   RasterImage^ destImage, 
   int rgb 
)  
def TranslateColor(self,destImage,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.

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

Requirements

Target Platforms

Help Version 23.0.2024.5.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.