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 the moment ChannelOffset works only with ie24RGB pixelformat.

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

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

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

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

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

ImageEnView.IEBitmap.ChannelOffset[0] := -255;
ImageEnView.IEBitmap.ChannelOffset[1] := -255;
ImageEnView.IEBitmap.ChannelOffset[2] := -255;
ImageEnView.Update;


Demo


  Demos\Display\DisplayAdjust\Display.dpr