Slice Example for Visual Basic
Private Sub RasterProc_OnSliceBitmap (ByVal Bitmap As Long, ByVal lLeft As Long, ByVal lTop As Long, ByVal lWidth As Long, ByVal lHeight As Long, ByVal lAngle As Long)
Static nCount As Integer
Dim RasterIO As New LEADRasterIO
Dim SliceRaster As New LeadRaster
Dim strFileName As String
Dim nRet As Integer
strFileName = "c:\Slices\" + Str$(nCount + 1) + ".bmp"
SliceRaster.Bitmap = Bitmap
nRet = RasterIO.Save (SliceRaster, strFileName, FILE_BMP, 24, QFACTOR_LEAD_1, SAVE_OVERWRITE)
If (nRet = 0) Then
nCount = nCount + 1
If (nCount > 10) Then RasterProc.ContinueSlicing = False
End If
Set SliceRaster = Nothing
Set RasterIO = Nothing
Private Sub ImageSlice_Click()
Dim nRet As Integer
nRet = RasterProc.Slice (Main.ActiveForm.LEADRasterView1.Raster, 500, RGB(0, 0, 0), SLICE_DESKEW Or SLICE_DESKEW_LINEAR Or SLICE_CUT_SLICES, True)
MsgBox "Deskew Angle :" + Str(RasterProc.SliceDeskewAngle)
End Sub