ClearImage COM Server
Open Method
See Also  Example  Send Feedback
FileName
PageNumber
Default value is 1.
CiImage Object : Open Method

Description

Create image from image file

Syntax

Visual Basic
Public Sub Open( _
   ByVal FileName As String, _
   Optional ByVal PageNumber As Long = 1 _
) 

Parameters

FileName
PageNumber
Default value is 1.

Remarks

!MISSING PHRASE '_ZONEFAIL_IMG'!

This method reads the following image file formats:

  • Bitonal:   TIFF, PCX, BMP, PDF 
  • Color and Grayscale: TIFF, BMP, PDF, WMF, JPEG, Targa, PCX, and PICT.

Multi Page TIFF and PDF image files are supported.  See EFileFormat for list of supported formats.
PDF read requires CiPdf license.

Additional formats might be supported.   Review current specification at www.inliteresearch.com or contact technical support support@inliteresearch.com

Example

VB Example (Visual Basic)Copy Code
Public Sub T_ImageFile(ByRef Img As CiImage, sFileName)
  Dim ImgZone As CiImage
  Dim sMulti: sMulti = "c:\tMulti.tif"
  Dim sZone: sZone = "c:\tZone.tif"
  Dim sSingle: sSingle = "c:\tSingle.tif"
    ' Open test
  Img.Open sFileName
    T_ImageInfo Img
      
    ' Save multi-page TIFF
  DeleteFile sMulti
  Set ImgZone = Img.CreateZone(Img.Width / 3, Img.Height / 3, _
                                Img.Width * 2 / 3, Img.Height * 2 / 3)
  Img.Append sMulti
    T_ImageInfo Img
    ImgZone.Invert:
    T_ImageInfo Img
  ImgZone.Append sMulti
    T_ImageInfo Img
  Img.Append sMulti
    Img.Invert
  Img.Append sMulti
  ImgZone.Append sMulti
    T_ImageInfo Img
    ' Open page
  Img.Open sMulti, 3
    Img.Invert
    T_ImageInfo Img
    ' Save test.  Save modified page to multi-page TIFF
  Img.Save
    T_ImageInfo Img
    ' Save as Zone Test
    Img.Invert
  ImgZone.SaveAs sZone
    T_ImageInfo Img
    ' Save as Test
  Img.SaveAs sSingle
    T_ImageInfo Img
End Sub

Public Sub T_ImageInfo(ByRef Img As CiImage)
  Debug.Print "Image #" & Img.Handle & "  File='" & Img.FileName & "'" & _
              "   Width=" & Img.Width & "   Height=" & Img.Height
  Debug.Print "  HorzDpi=" & Img.HorzDpi & "dpi   VertDpi=" & Img.VertDpi & "dpi" & _
              "  Page=" & Img.PageNumber & "  Page Count =" & Img.PageCount & _
              "  Format:=" & Img.Format & _
              IIf(Img.IsModified, "  MODIFIED", "")
End Sub
Process Multi-page file (Visual Basic)Copy Code
Public Sub T_MultiPageFile(ByRef Img As CiImage, sFileName As String)
  Dim nPage, nPageCount
  Img.Open sFileName
  nPageCount = Img.PageCount
    ' for each page
  For nPage = 1 To nPageCount
    Img.Open sFileName, nPage
        '  Process  image page
        '  ==== Read barcodes
        '     Set BarcodePro.Image = Img
        '     BarcodePro.Find 0
        '     ' process barcodes
        '  ==== Repair image
        '     Set Repair.Image = Img
        '     Repair.AutoDeskew
        '     Img.Append sFileOut ' save
  Next
End Sub

See Also

© 1992-2011. Inlite Research, Inc. All Rights Reserved.