Visual Basic |
---|
Public Sub SaveAs( _ ByVal FileName As String, _ Optional ByVal Format As EFileFormat = ciEXT _ ) |
- FileName
- Format
Default value ciEXTValue 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 Group3 compression, bpp=1 ciTIFF_G4 TIFF Group 4 compression, bpp=1 ciTIFF_JPEG TIFF JPEG compression, bpp=8, 24 ciTIFF_LZW ciTIFF_NEOL TIFF No-end-of-line compression, bpp=1 ciWBMP Wireless Bitmap format, 255x255 max. bpp=1
This method saves the following image file formats:
- Bitonal: TIFF, PCX, BMP
- Color and Grayscale: TIFF, BMP, WMF, JPEG, Targa, PCX, and PICT.
If Format=ciEXT, then the format is derived from file extension of the FileName parameter.
See EFileFormat for list of supported formats. Some formats are "read-only" and are not supported by this method.
Additional formats might be supported. Review current specification at www.inliteresearch.com or contact technical support support@inliteresearch.com
Some formats use lossy compression. Saving images with those compression methods will modify the saved image as compared to the original image. For JPEG, the amount of JPEG compression is controlled by the JpegQuality parameter.
Not all formats support the range of CiImage. BitsPerPixel values. Prior to being saved, the image is converted to the nearest supported BPP of that particular format. For example, a bitonal image is converted to Grayscale prior to saving as a JPEG format. The saved file image may show severe blocking effects, typical of JPEG. Similarly a Color or Grayscale image is converted to bitonal prior to being saved as a TIFF format.
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 |
CiImage Object | CiImage Members | Open | Save | SaveAs | Append