Zoom-In / Zoom-Out Not working Properly (Document Imaging SDK)

  Imaging Toolkit

Question:
When I display an image and then press the zoom-in or zoom-out Buttons, nothing happens. If I select an area of the image and it Zooms into that
area, I find the zoom-in or zoom-out now work But sometimes in an unpredictable way.

Answer:
The problem was that the scale mode wasn’t set properly. If you want to use ZoomIn or ZoomOut methods you have to set the scale mode to tifsmNoScale as the following:

BlackIce1.ScaleMode = tifsmNoScale

The code is the following:

‘——– Load & Display a Tiff Image into BlackIce1 control
Private Sub Form_Load()
‘ BiDisp control settings
BlackIce1.Zoom = tif2sEnable
BlackIce1.ZoomWithKeyboard = tif2sDisable
BlackIce1.ScrollBars = tifsbBoth
‘ you have to set scale mode to tifsmNoScale to use ZoomIn and ZoomOut
methods
BlackIce1.ScaleMode = tifsmNoScale

Dim fileName As String ‘ name of the tiff file
Dim hdib As Long ‘ hanle of the DIB
Dim BiTiffobj As Object ‘ dinamic allocated BiTiff object

‘ load tiff file
fileName = “C:\BankTest.tif”
Set BiTiffobj = CreateObject(“BITIFF.BITiffCtrl.1”)
hdib = BiTiffobj.LoadTiffIntoDIB(fileName, 0, 0)
Set BiTiffobj = Nothing

‘ test file existing
If hdib = 0 Then
MsgBox (“File does not exist!”)
Else
‘ set the content of the BiDisp control
BlackIce1.hdib = hdib
End If
End Sub

‘—— Zoom In Button ————————————
Private Sub ZoomINbtn_Click()
BlackIce1.ZoomIn
End Sub

‘—— Zoom Out Button ————————————
Private Sub ZoomOUTbtn_Click()
BlackIce1.ZoomOut
End Sub

Regards,
Technical Support Team