ClearImage COM API
Open Method
CiImage Object : Open Method
Path to existing local or network file
The default value is 1.
Description
Create image from an image file
Syntax
Visual Basic
Public Sub Open( _
   ByVal FileName As String, _
   Optional ByVal PageNumber As Long = 1 _
) 
Parameters
FileName
Path to existing local or network file
PageNumber
The default value is 1.
Remarks

This method generates an error if object.Image.IsZone is true.

This method reads the following image file formats:

Multi-page TIFF and PDF image files are supported.  See EFileFormat for the list of supported formats.

See Image file opening guidelines on Inlite's How-to Web Site

Example
Sub OpenSaveAppendImages(imageFile1 As String, imageFile2 As String, pdfFileOut As String)
  Dim Ci As New CiServer
  Dim Image As CiImage: Set Image = Ci.CreateImage
    ' Create PDF file with image from the first file
  Image.Open imageFile1, 1
  Image.SaveAs pdfFileOut, cifPDF
    ' Append to PDF file image from the second file
  Image.Open imageFile2, 1
  Image.Append pdfFileOut, cifPDF
    '  Open PDF and show image information
  Image.Open pdfFileOut, 2
  ShowImageInfo Image
    '  Close image
  Image.Close
End Sub

Sub ShowImageInfo(Image As CiImage)
  Debug.Print "  File='" & Image.fileName & "'" & " Page=" & Image.PageNumber & " PageCount=" & Image.PageCount & "  Format=" & Image.Format & vbCrLf
  Debug.Print "  Width=" & Image.Width & "  Height=" & Image.Height & "  BPP=" & Image.BitsPerPixel & " HorzDpi=" & Image.HorzDpi & "   VertDpi=" & Image.VertDpi & vbCrLf
End Sub
Sub ProcessMultiPageFile(imageFile As String)
  Dim Ci As New CiServer
  Dim Image As CiImage: Set Image = Ci.CreateImage
  Dim page As Integer, pageCount As Integer
  Image.Open imageFile
  pageCount = Image.pageCount
    ' for each page
  For page = 1 To pageCount
    Image.Open imageFile, page
        '  Process  image page, for example
        '  ==== Read barcodes
        '     Set BarcodePro.Image = Image
        '     BarcodePro.Find 0
        '     ' process barcodes
        '  ==== Repair image
        '     Set Repair.Image = Image
        '     Repair.AutoDeskew
        '     Image.Append sFileOut ' save
  Next
End Sub
See Also

CiImage Object  | CiImage Members  | Open  | Save  | SaveAs  | Append