ImageEn, unit iexBitmaps

TIEBitmap.ChannelOffset

TIEBitmap.ChannelOffset


Declaration

property ChannelOffset[idx: integer]: integer;


Description

Allows an offset for each channel to be specified. Idx is the channel where 0=red, 1=green and 2=blue
At this time, ChannelOffset works only with ie24RGB pixelformat.

For example, to display only the red channel, just set green and blue to -255:

ImageEnView1.IEBitmap.ChannelOffset[1] := -255;  // hide green
ImageEnView1.IEBitmap.ChannelOffset[2] := -255;  // hide blue
ImageEnView1.Update();

ChannelOffset is useful also to increase or decrease luminosity (brightness). Example:

// trackbar1 has min=-255 and max=255.
ImageEnView1.IEBitmap.ChannelOffset[0] := trackbar1.Position;
ImageEnView1.IEBitmap.ChannelOffset[1] := trackbar1.Position;
ImageEnView1.IEBitmap.ChannelOffset[2] := trackbar1.Position;
ImageEnView1.Update();

Finally you can use ChannelOffset to display the alpha channel as a black image, hiding all channels. Example:

ImageEnView1.IEBitmap.ChannelOffset[0] := -255;
ImageEnView1.IEBitmap.ChannelOffset[1] := -255;
ImageEnView1.IEBitmap.ChannelOffset[2] := -255;
ImageEnView1.Update();

Note: To permanently apply the offset to the image, use FixChannelOffset


Demo

Demo  Demos\Display\DisplayAdjust\Display.dpr