ImageControls:
Product
Support Overview
ImageControls 3:
Product
Support Overview
Application
Notes
Downloads
Library
Error
Codes
FAQs
Revision
Levels
Supported
Configurations
Technical
Documentation
OTHER TOOLS:
Knowledgebase
Support
Request
PRODUCT INFO:
Product
Overview
IC Toolkit 3.1 is the most recent release of the ImageControls Toolkit.
If you are running a previous version of Kofax ImageControls, refer to the ImageControls How to Buy Web page for details on how to obtain the appropriate ImageControls 3 release for your configuration.
Some ImageControls developers have inquired as to the ability to view zoned sections of an image within a second KView window. This article shows how easy it is to create a KView window that will perform this function with a ImageControls application.
This project modifies the original demonstration utility, VBDEM32x.EXE, source code as provided with the ImageControls Toolkit. It consists of the following:
Figure 1 displays the placement of these objects on the form.
This form is accessed from the main form, frmMain, of VBDemo. A menu selection was added to the View pull down menu of the main form. When this is selected, frmZoomView is displayed containing the zoomed in selected zone of the image. The active image, g_ActiveKview object, in the main form contains the original image. The item mnuViewZoomVW is added after the item mnuViewDisplayProperties in the Menu Editor for the menu of the main form.
The procedure Private Sub mnuView_Click()was modified with the following:
'***** Update Zone Zoom View availability
mnuViewZoomVW.Enabled = g_ActiveKView.Displayed
This change was added to the end of the procedure so that the menu item would only become available when a active image was being viewed and ready for a zone to be created and viewed.
The following code was created so that the new form would be displayed when this menu item was selected:
Private Sub mnuViewZoomVW_Click()
'***** Verify that one active zone is set on image. If so, change
'***** main menu selection, load and display form to display.
'***** Otherwise, tell user to have one zone on image.
If g_ActiveKView.ZoneCount = 1 Then
mnuViewZoomVW.Checked = Not mnuViewZoomVW.Checked
Load frmZoomView
frmZoomView.Show
Else
MsgBox ("One Zone must be created/available on the image")
End If
End Sub
The zone image view will only be available after the user has created one (1) zone. Otherwise, they will be notified that one zone must be created on the original image. During the main form load event, frmMain_Load, the demonstration source code defaults the initial banding mode on the mouse so that the left button zooms in on a selected section and the right button pans.
'***** Set up initial banding mode to left button zoom and
'***** right button pan
KViewLeft.BandingMode = KVBANDINGMODEMOUSEUPZOOM
KViewRight.BandingMode = KVBANDINGMODEMOUSEUPZOOM
KViewLeft.BandingRight = KVBANDINGMODEPAN
KViewRight.BandingRight = KVBANDINGMODEPAN
This was modified so that the left button creates a zone and the right button would adhere to standard VB mouse events.
'***** Set up initial banding modes for Zoom modification. Left
'***** button zone create & edit, right button normal. Right
'***** button used to delete created zone.
KViewLeft.BandingMode = KVBANDINGMODEZONECREATEEDIT
KViewRight.BandingMode = KVBANDINGMODEZONECREATEEDIT
KViewLeft.BandingRight = KVBANDINGMODENORMAL
KViewRight.BandingRight = KVBANDINGMODENORMAL
This was done so that the zone could be created by the user. The left button would be used to create the zone while the right mouse button would be used to delete any and all zones on the image. The KView_MouseUp event will determine if the right mouse button was selected.
Private Sub KViewLeft_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'***** If right mouse button selected, delete zones, refresh
'***** display and set main menu selection to false.
If Button = 2 Then
g_ActiveKView.ZoneAction = KVZONEACTIONDELETEALL
g_ActiveKView.Refresh
mnuViewZoomVW.Checked = False
End If
End Sub
The procedure OpenFile() is used by the demonstration utility to open images for viewing. This procedure was modified so that when it is executed, and the mnuViewZoomVW selection is true, the form frmZoomView is displayed with the selected zone.
'***** If View Zone is activated, then unload previous
'***** frmZoomView, load frmZoomView and show form.
If mnuViewZoomVW.Checked Then
Unload frmZoomView
mnuViewZoomVW.Checked = True
Load frmZoomView
frmZoomView.Show
End If
After this point, all additional code is contained in its own module with its own form and its own KView control, KViewZoom.
The size and placement of the form is the first step when the form is loaded. Second, A zone is created that matches the zone specified in the active view. The KViewZoom is set to the same image as the active image and the image is opened without displaying it. Finally, the selected zone of the image is set to fit in the window and the view refreshed so that it will be displayed.
Private Sub Form_Load()
'***** Set size of Zoom View form.
Width = Screen.Width * 0.4 ' Set width of form.
Height = Screen.Height * 0.4 ' Set height of form.
Left = Screen.Width / 2 ' Set form horizontally.
Top = (Screen.Height - Height) / 2 ' Center form vertically.
'***** Create a zone in the window that matches the zone in
'***** created in the main view.
KViewZoom.ZoneAction = KVZONEACTIONCREATE
KViewZoom.ZoneUnits = g_ActiveKView.ZoneUnits
KViewZoom.ZoneHeight = g_ActiveKView.ZoneHeight
KViewZoom.ZoneWidth = g_ActiveKView.ZoneWidth
KViewZoom.ZoneTop = g_ActiveKView.ZoneTop
KViewZoom.ZoneLeft = g_ActiveKView.ZoneLeft
'***** Select image for zoom display.
KViewZoom.FileName = g_ActiveKView.FileName
KViewZoom.FitWidth = True
KViewZoom.FitHeight = True
'***** Open the image
KViewZoom.Action = KVACTIONOPENIMAGE
'***** Scale image so that the selected zone will fit.
KViewZoom.ZoneAction = KVZONEACTIONFITWINDOW
'***** Refresh the display
KViewZoom.Refresh
End Sub
The form may be resized. If the form is resized, so is the KView control and the image being displayed.
Private Sub Form_Resize()
'***** If window is being minimized, skip Resize of controls
If Me.WindowState = 1 Then
Exit Sub
End If
'***** Resize view controls based on window size and Picture bar
KViewZoom.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
'***** Refresh the display
KViewZoom.Refresh
End Sub
If the user decides to close the form, it is unloaded from the system and the mnuViewZoomVW.Checked selection is set to false.

Figure 1
The Kofax ImageControls support group is skilled in Visual Basic and Visual C++ development and can assist developers in building their custom imaging applications. Our engineers can also point developers to source code samples on the Kofax FTP site.
The ImageControls 3 Technical Support Web pages have been kept up to date. We encourage ImageControls developers to investigate the information in these Web pages before looking for other sources of support. Use the menu options in the upper left side of this page to access additional product support Web pages for this product.
For details regarding technical support available for all Kofax products, please review the current Support Overview & Options and Product Support Eligibility Matrix Web pages.
