WindowLevel example for Visual Basic

This example converts a bitmap to 12-bit grayscale and then performs window leveling on the four most significant bits of the image.

    Lead1.Grayscale 12    'Grayscale image to 12-bit

    Lead1.LevelLowBit = 8 ' use 4 most significant bits

    Lead1.LevelHighBit = 11

    Lead1.WindowLevel