Save the image to a file
Visual Basic |
---|
Public Sub SaveAs( _ ByVal FileName As String, _ Optional ByVal Format As EFileFormat = ciEXT _ ) |
Value | Description |
---|---|
ciBMP | BMP format. bpp= 1, 8, 24 |
ciEXT | Format is based on file name extension |
cifICL | Image Cash Letter format. bpp=1, 8, 24 |
cifPDF | PDF Format. bpp=1, 8, 24 |
ciGIF | GIF format. bpp= 1, 8, 24. Read only |
ciICO | Windows icon format, 255x255 max. bpp=8, 24 |
ciJBG | JBIG format. bpp=1. Read only |
ciJP2 | JPEG-2000 format. bpp=8, 24 |
ciJPC | JPEG 2000 Code stream. bpp=8 |
ciJPG | JPEG format. bpp=8, 24 |
ciPCX | PCX format. bpp= 1, 8, 24 |
ciPGX | JPEG-2000 verification model. bpp=8 |
ciPNG | Portable Network Graphic format. bpp= 1, 8, 24 |
ciPNM | Portable aNyMap format. bpp=8 |
ciTGA | Targa format. bpp=8, 24 |
ciTIFF | Uncompressed TIFF format. bpp= 1, 8, 24 |
ciTIFF_G3_1D | TIFF Group 3 compression, bpp=1 |
ciTIFF_G4 | TIFF Group 4 compression, bpp=1 |
ciTIFF_JPEG | TIFF JPEG compression, bpp=8, 24 |
ciTIFF_LZW | TIFF LZW compression, bpp=1, 8, 24 |
ciTIFF_NEOL | TIFF No-end-of-line compression, bpp=1 |
ciWBMP | Wireless Bitmap format, 255x255 max. bpp=1 |
ciWEBP | WEBP. bpp=24 |
ciWMF | Windows Metafile |
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 pComprColorEx. JpegQuality property controls compression when pComprColor=citcJPEG or file format is JPEG.
See Image file saving guidelines on Inlite's How-to Web Site
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
CiImage Object | CiImage Members | Open | Save | SaveAs | Append