ApplyVOILUT Example for Visual Basic

Function TestVOILUT(ByVal bLinear As Boolean)
  Dim i As Integer
  Dim Data As New LEADRasterVariant
  Dim RasterProc As New LEADRasterProcess
  Dim LUT(4096) As Long

  If (bLinear) Then
   RasterProc.ApplyLinearVOILUT LEADRasterView1.Raster, 330#, 600#, 0
  Else
   For i = 0 To 4096
    If (i < 30) Then
      LUT(i) = 0
     Else
      If (i > 630) Then
        LUT(i) = 630
      Else
       LUT(i) = i
      End If
     End If
   Next i

   Data.Type = VALUE_ARRAY_LONG
   Data.ItemCount = 4096
   For i = 0 To Data.ItemCount - 1
     Data.LongItemValue(i) = LUT(i)
   Next i

   RasterProc.ApplyVOILUT LEADRasterView1.Raster, Data, 0, 0

End If

End Function