ImageControls 3.1 Application NoteImageControls Toolkit 3.1 is the latest release of the Kofax ImageControls Toolkit product. |
To access the following Web pages for this release, please click on the desired page's link. Application Notes - Error Codes - Frequently Asked Questions - Revision Levels - Supported Configurations |
Creating a Viewing Window for ZonesSome 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:
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:
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.
This was modified so that the left button creates a zone and the right button would adhere to standard VB mouse events.
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)
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.
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.
The form may be resized. If the form is resized, so is the KView control and the image being displayed.
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
|
