Vcl.Graphics.CreateMappedBmp

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateMappedBmp(Handle: HBITMAP; const OldColors, NewColors: array of TColor): HBITMAP;

C++

extern DELPHI_PACKAGE HBITMAP __fastcall CreateMappedBmp(HBITMAP Handle, const System::Uitypes::TColor *OldColors, const int OldColors_High, const System::Uitypes::TColor *NewColors, const int NewColors_High);

Properties

Type Visibility Source Unit Parent
function public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics Vcl.Graphics

Description

Changes the color table in a bitmap.

Call CreateMappedBmp to make selective changes to the color map of a bitmap. This function replaces the colors specified by the OldColors parameter with the colors specified by the NewColors parameter and returns the handle for a new device dependent bitmap (DDB) that uses the new color table. Handle is the handle to the bitmap whose color table should be changed. In C++, specify the size of the color arrays in OldColors_Size and NewColors_Size. This value should be the index of the last entry in the corresponding array.The OldColors and NewColors arrays should contain the same number of elements.

CreateMappedBmp creates a new bitmap. It does not alter the original bitmap, which has the handle specified by the Handle parameter.

Note: CreateMappedBmp does not work with bitmaps that have more than 256 colors. For bitmaps with more than 256 colors (8bpp), this function returns the original bitmap.

See Also