CreateMaskFromRgn example for Visual Basic
Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
' This example loads an image, sets a color region using black, }
' and then creates a 1-bit mask image from that bitmap. }
nRet = RasterIO.Load(LEADRasterView1.Raster, "C:\PARROTS.JPG", 0, 0, 1)
If (nRet = 0) Then
LEADRasterView1.Raster.SetRgnColor RGB(0, 0, 0), L_RGN_SET
nRet = LEADRasterView1.Raster.CreateMaskFromRgn
If (nRet = 0) Then
LEADRasterView2.Raster.Bitmap = LEADRasterView1.Raster.MaskBitmap
End If
End If