ClearImage COM API
SaveAs Method
CiImage Object : SaveAs Method
Path to local or network file
Description
Save the image to a file
Syntax
Visual Basic
Public Sub SaveAs( _
   ByVal FileName As String, _
   Optional ByVal Format As EFileFormat = ciEXT _
) 
Parameters
FileName
Path to local or network file
Format
ValueDescription
ciBMPBMP format. bpp= 1, 8, 24
ciEXTFormat is based on file name extension
cifICLImage Cash Letter format. bpp=1, 8, 24
cifPDFPDF Format. bpp=1, 8, 24
ciGIFGIF format. bpp= 1, 8, 24. Read only
ciICOWindows icon format, 255x255 max. bpp=8, 24
ciJBGJBIG format. bpp=1. Read only
ciJP2JPEG-2000 format. bpp=8, 24
ciJPCJPEG 2000 Code stream. bpp=8
ciJPGJPEG format. bpp=8, 24
ciPCXPCX format. bpp= 1, 8, 24
ciPGXJPEG-2000 verification model. bpp=8
ciPNGPortable Network Graphic format. bpp= 1, 8, 24
ciPNMPortable aNyMap format. bpp=8
ciTGATarga format. bpp=8, 24
ciTIFFUncompressed TIFF format. bpp= 1, 8, 24
ciTIFF_G3_1DTIFF Group 3 compression, bpp=1
ciTIFF_G4TIFF Group 4 compression, bpp=1
ciTIFF_JPEGTIFF JPEG compression, bpp=8, 24
ciTIFF_LZWTIFF LZW compression, bpp=1, 8, 24
ciTIFF_NEOLTIFF No-end-of-line compression, bpp=1
ciWBMPWireless Bitmap format, 255x255 max. bpp=1
ciWEBPWEBP. bpp=24
ciWMFWindows Metafile
Remarks

This method saves in the format specified by Format parameter. If Format=ciEXT, then the format is derived from the  FileName extension. This is a default value.  Image compression of TIFF and PDF files is controlled by pComprBitonal and pComprColorExJpegQuality property controls compression when pComprColor=citcJPEG or file format is JPEG.

See Image file saving 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