Vcl.Graphics.CreateMappedRes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateMappedRes(Instance: THandle; ResName: PChar; const OldColors, NewColors: array of TColor): HBITMAP;

C++

extern DELPHI_PACKAGE HBITMAP __fastcall CreateMappedRes(NativeUInt Instance, System::WideChar * ResName, 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 resource.

Call CreateMappedRes to make selective changes to the color map of a resourced 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. Use the Instance and ResName parameters to identify the bitmap resource whose color table should be changed. In C++, indicate the number of elements in the color arrays by the OldColors_Size and NewColors_Size parameters. These values should be the index of the last element in the corresponding color array, not the number of entries. The OldColors and NewColors arrays should contain the same number of elements.

Note: CreateMappedRes does not work with bitmaps that have more than 256 colors. For bitmaps with more than 256 colors (8bpp), this function returns an instance of the original bitmap without color modifications.

See Also