Q: How can I correct the defects of the image after scanning or faxing?
A: There are many methods in the Document Imaging ActiveX OCXs to correct image defects. In this user guide we mention using of some methods to correct image faults. If you have a noisy image after faxing, you can apply the CleanImage method in the BIDOCIMG.OCX. (See the description of the method.) There may be many errors after scanning. The image may be skewed. The DetectSkewAngle and DeskewDIB method in the BIDOCIMG.OCX can solve this problem.(See the description of the methods.) If you want to remove punch holes from the image, you can do it with PunchHoleRemoveror AutoPunchHoleRemovermethods. These methods are in the BIDOCIMG.OCX. (See the description of the methods.) There is a black border around the image after scanning in many cases. The TrimBlackBorder method can eliminate the border. This method is in the BIDOCIMG.OCX (see the description of the method).
Code example:
Dim hDib As Long
Dim lAngle As Long
Dim Msg As String
hDib = MDIForm1.ActiveForm.BiDisp.hDib
hDib = BIDocImgObj.CleanImage(hDib, 80, True)
…
lAngle = BIDocImgObj.DetectSkewAngle(hDib, True, True)
Msg = "The Angle of Skewing: " & lAngle
MsgBox Msg, vbOKOnly + vbInformation, "Result of Detecting"
…
hDib = BIDocImgObj.DeskewDIB(hDib, True, True, True)
…
hDib = BIDocImgObj.AutoPunchHoleRemover(hDib, True)
…
hDib = BIDocImgObj.TrimBlackBorder(hDib)
…
Set BIDocImgObj = Nothing