←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
Objective-C
C++
Java
PublicOverloadsFunctionTranslateColor( _ByValdestImageAsRasterImage, _ByValcolorAsRasterColor_)AsRasterColor
- (LTRasterColor *)translateColor:(LTRasterImage *)dstImagecolor:(LTRasterColor *)color
publicRasterColor translateColor(RasterImagedestImage,RasterColorcolor)

Parameters

destImage
DestinationRasterImageobject.

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 theRasterColor.IsPaletteIndexistrue). 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), useGetTrueColorValue.

Example

For an example, refer toTransparentColor

Requirements

Target Platforms

Leadtools Assembly
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.