←Select platform

TranslateColor(RasterImage,RasterColor) Method

Summary

Translates the specified color in the image, and returns the nearest matching color in the destination image.

Syntax

C#
VB
Java
Objective-C
WinRT C#
C++
Public Overloads Function TranslateColor( _ 
   ByVal destImage As Leadtools.RasterImage, _ 
   ByVal color As Leadtools.RasterColor _ 
) As Leadtools.RasterColor 
- (LTRasterColor *)translateColor:(LTRasterImage *)dstImage  
                            color:(LTRasterColor *)color 
             
public RasterColor translateColor( 
  RasterImage destImage,  
  RasterColor color 
) 
             
 function Leadtools.RasterImage.TranslateColor(RasterImage,RasterColor)(  
   destImage , 
   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.

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.

Example

For an example, refer to TransparentColor

Requirements

Target Platforms

Help Version 19.0.2017.10.19
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly