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 can develop your own code that sits between iBase and the source system.
About this task
This topic is intended for administrators and developers who want to develop code to implement iBasePlate Analysis Image Retrieval from the ALPR 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) that the iBase user wants to see. When the interface receives the image request, its behavior and further actions are controlled by the development carried out by you. Normally this involves retrieving the image from the ALPR source system and displaying it.
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 that 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:
Create a new VB ActiveX DLL project. This creates a project called Project1 containing a class module with the name Class1.
Add a reference to ANPRExternalInterfaces to your Project.
Add a Form to the project.
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"
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
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
Add the ProgID of your class module to the registry. The following three lines might 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"
Compile your project.