WindowLevel example for Delphi
This example converts a bitmap to 12-bit grayscale and then performs window leveling on the eight least significant bits of the image.
Lead1.Grayscale (12); {Grayscale image to 12-bit}
{use least significant 8 bits}
Lead1.LevelLowBit := 0;
Lead1.LevelHighBit := 7;
Lead1.WindowLevel;