Implementing Image Retrieval

iBase has the ability to store images as part of a record. In situations where the iBase records are not populated with an image you have the option of developing your own code that sits between iBase and the source system. This code implements a type library interface that allows iBase to provide instructions detailing the image and type of image (either number plate or entire vehicle) the iBase user wishes to see. Once the interface has received the image request its behavior and further actions are controlled by the development carried out by you. Normally this will involve retrieving the image from the ALPR source system and displaying it.

About this task

This topic is intended for administrators and developers who intend to implement iBasePlate Analysis Image Retrieval from the ALPR source system.

Important: This topic contains specific information regarding editing the Windows Registry. You should always back up the registry before you edit it. If you alter the registry, you could cause your computer to stop functioning. i2 provides this information "as is", without representation or warranty of any kind, express or implied, including without limitation any warranty concerning the accuracy, adequacy, or completeness of such information contained herein. i2 does not assume responsibility for the use or inability to use the software product as a result of providing this information.
To create the code that works with iBase Plate Analysis Image Retrieval the developer must implement the IImageRetrieval interface from the ANPRExternalInterfaces.tlb type library which is installed as part of the general iBase Plate Analysis installation. A description of the ANPRExternalInterfaces.tlb type library is given below.
<<interface>>ANPRExternalInterfaces.tlb::IImageRetrieval
+ShowImage(inVRM : String,
 in ImageDate : String,
 in ImageTime : String,
 in ReadID : String,
 in PartialOnly : Boolean)

Procedure

This example program accepts the image retrieval parameters from iBase and displays them to the user in a modal dialog:
  1. Create a new VB ActiveX DLL project. This creates a project called Project1 containing a class module with the name Class1.
  2. Add a reference to ANPRExternalInterfaces to your Project.
  3. Add a Form to the project.
  4. On the form, create the following controls, and set the design-time properties shown.
      Control         Name        Property
       --------------------------------------------
       Label           Label1      Caption="VRM"
       Label           Label2      Caption="Date"
       Label           Label3      Caption="Time"
       Label           Label4      Caption="Read ID"
       Label           Label5      Caption="Type"
    
       Command Button  Command1    Caption="OK"
    
    
  5. Add the following code to the Form:
    Option Explicit
       Public Sub ShowImageDetails(ByVal VRM As String, _
                                   ByVal ImageDate As String, _
                                   ByVal ImageTime As String, _
                                   ByVal ReadID As String, _
                                   ByVal PartialOnly As Boolean)
           Label1.Caption = VRM
           Label2.Caption = ImageDate
           Label3.Caption = ImageTime
           Label4.Caption = ReadID
           If PartialOnly Then
               Label5.Caption = "Partial Image"
           Else
               Label5.Caption = "Full Image"
           End If
       End Sub
       Private Sub Command1_Click()
           Unload Me
       End Sub
    
    
  6. Add the following code to your ClassModule:
       Option Explicit
       Implements ANPRExternalInterfaces.IImageRetrieval
       Private Sub IImageRetrieval_ShowImage(ByVal VRM As String, _
                                             ByVal ImageDate As String, _
                                             ByVal ImageTime As String, _
                                             ByVal ReadID As String, _
                                             ByVal PartialOnly As Boolean)
           Dim ImageDisplay As Form1
           On Error GoTo ErrorSub
           ' Code to retrieve the image from the source system and
           ' display it to the user goes here
           Set ImageDisplay = New Form1
           ImageDisplay.ShowImageDetails VRM, _
                                         ImageDate, _
                                         ImageTime, _
                                         ReadID, _
                                         PartialOnly
     
           ImageDisplay.Show vbModal
           Exit Sub
       ErrorSub:
           MsgBox "Error:" & CStr(Err.Number) & ":" & Err.Description
       End Sub
    
    
  7. Add the ProgID of your class module to the registry. The following three lines may be saved to a file with the .reg extension and imported into the registry through the RegEdit program:
    Windows Registry Editor Version 5.00
    
       [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\i2\iBase\8\ANPR]
    
       "IR_ProgID"="iBaseANPR_IR.iBaseANPR_IR"
    
  8. Compile your project.