virtual COLORREF LBitmapBase::TranslateColor(LBitmapSrc, crColor)
Translates the specified color in the source class object's bitmap, and returns the nearest matching color in the calling object's bitmap.
The source bitmap object.
The COLORREF value that specifies the color in the source bitmap to be translated. You can get the value from a palette entry or by using LBitmapBase::GetPixelColor.
The COLORREF value or the palette index of the nearest matching color in calling object's bitmap. If the calling object's bitmap is 8 bits per pixel or less, this is always the palette index. Otherwise, it is the COLORREF value.
When creating a target bitmap for animation, you can use this function to ensure that the correct color is specified as the background color.
Note: The LBitmapSrc parameter is passed by reference, and is a required parameter.
Win32, x64.
L_INT LBitmapBase__TranslateColorExample()
{
L_INT nRet;
LBitmapBase MyBitmap, Bitmap2;
MyBitmap.SetFileName(MAKE_IMAGE_PATH(TEXT("image1.cmp")));
nRet =MyBitmap.Load(32); //load at 32 bit per pixel
if(nRet != SUCCESS )
return nRet;
COLORREF Color=MyBitmap.GetPixelColor(100,200);
nRet =Bitmap2.Load(MAKE_IMAGE_PATH(TEXT("image2.cmp")));
if(nRet !=SUCCESS)
return nRet;
Color=MyBitmap.TranslateColor(Bitmap2, Color);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.