TByteMap.ReadFrom

procedure ReadFrom(Source: TBitmap32; Conversion: TConversionType);

Description

ReadFrom allows reading and converting data from TBitmap32 objects into the byte map.

First, the byte map is resized to fit the Source bitmap dimensions, then the 32-bit RGBA color is transformed to 8-bits depending on the conversion type:

Conversion Action
ctRed Copies red channel
ctGreen Copies green channel
ctBlue Copies blue channel
ctAlpha Copies alpha channel
ctUniformRGB Copies averaged value: (R + G + B) / 3
ctWeightedRGB Copies intensity: R * 0.21 + G * 0.71 + B * 0.08

See Also

TBitmap32, TConversionType