ImageEn, unit iexBitmaps

TIEBitmap.ChannelOffset

TIEBitmap.ChannelOffset


Declaration

property ChannelOffset[Ch: TIEChannel]: integer;


Description

Allows an offset for each channel to be specified (in the range -255 to +255).
Ch is the channel: iecRed, iecGreen or iecBlue.
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[ iecGreen ] := -255;  // hide green
ImageEnView1.IEBitmap.ChannelOffset[ iecBlue ]  := -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[ iecRed ]   := TrackBar1.Position;
ImageEnView1.IEBitmap.ChannelOffset[ iecGreen ] := TrackBar1.Position;
ImageEnView1.IEBitmap.ChannelOffset[ iecBlue ]  := 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[ iecRed ]   := -255;
ImageEnView1.IEBitmap.ChannelOffset[ iecGreen ] := -255;
ImageEnView1.IEBitmap.ChannelOffset[ iecBlue ]  := -255;
ImageEnView1.Update();

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

Default: 0 for all channels


Demo

Demo  Demos\Display\DisplayAdjust\Display.dpr


Compatibility Notes

In versions prior to v13.7.0, ChannelOffset[] used an integer to specify the channel: 0 = iecRed, 1 = iecGreen and 2 = iecBlue


See Also

FixChannelOffset
Contrast
BlackValue
WhiteValue