SetMinMaxBits Example for Visual Basic
Dim RasterProc As New LEADRasterProcess
' set the grayscale LUT
If (LEADRasterView1.Raster.IsGrayscale) <> GRAY_NO And (LEADRasterView1.Raster.BitmapBits > 8) Then
LEADRasterView1.Raster.GetMinMaxBits
LEADRasterView1.Raster.SetMinMaxBits LEADRasterView1.Raster.MinBit, LEADRasterView1.Raster.MaxBit
LEADRasterView1.Raster.GetMinMaxVal
Dim window As Double
Dim center As Double
window = (LEADRasterView1.Raster.MaxVal - LEADRasterView1.Raster.MinVal)
center = window / 2
RasterProc.ApplyLinearVOILUT LEADRasterView1.Raster, window, center, 0
End If