Vcl.Graphics.CreateGrayMappedRes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateGrayMappedRes(Instance: THandle; ResName: PChar): HBITMAP;

C++

extern DELPHI_PACKAGE HBITMAP __fastcall CreateGrayMappedRes(NativeUInt Instance, System::WideChar * ResName);

Properties

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

Description

Remaps the standard gray colors in a bitmap resource with the system grays.

Call CreateGrayMappedRes to create a bitmap that uses the system gray colors (clBtnHightlight, clBtnFace, clBtnShadow and clBtnText) from a resourced bitmap that uses standard gray scale colors (clWhite, clSilver, clGray, and clBlack). This allows an application to dynamically create images that match the user's control panel settings, by creating a base image as a bitmap resource.

Use the Instance and ResName parameters to identify the bitmap resource whose color table should be changed

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