|
Question : Need to Save Scanned Image in gif format.
|
|
I have a database that uses the Kodak ActiveX controls to scan drawings and save them to a network drive. It's been working so-so.
If the resolution is set too high...say 200 dpi (not as high as we really need it)...then the scanned image will not be displayed on the ImgEdit control.
The example database I found includes the following code to save the image. I've been using this without the second argument, and it works, but it produces huge file sizes. I presume this is because it is not compressing it to the file format but writing it out uncompressed. Note that I am not using this routine. My own does not use the ScanAdmin.ShowFileDialog line to get a file type. Instead every image is to be saved to the same directory with the same filetype.
I've been giving the files a .tif extension manually. What I would really like to do is save the file in gif format, compression and all...so that the drawings are more readable.
Dim strFilter As String Dim strInputFileName As String Me.ScanAdmin.ShowFileDialog 1 strInputFileName = Me.ScanAdmin.Image If Len(strInputFileName) > 0 Then Select Case Right(strInputFileName, 3) Case "tif" Me.scanEdit.SaveAs strInputFileName, 1 Case "jpg" Me.scanEdit.SaveAs strInputFileName, 6 End Select End If
|
|
Answer : Need to Save Scanned Image in gif format.
|
|
From the help file. The syntax is:
object.SaveAs Image[,FileType,PageType,CompressionType,CompressionInfo,SaveAtZoom]
Image String The fully-qualified name of the image document being saved FileType Integer The FileType the image is being saved as PageType Integer The PageType the image is being saved as CompressionType Integer The CompressionType at which the image is being saved CompressionInfo Integer The CompressionInfo setting of the image being saved SaveAtZoom Boolean Whether the image is being saved using the current or original scale percentage value: True The image is being saved using the current scale percentage value: False The image is being saved using the original scale percentage value
The following list shows the valid FileType settings:
Constant Setting Description wiFileTypeTIFF 1 TIFF wiFileTypeAWD 2 AWD wiFileTypeBMP 3 BMP wiFileTypePCX 4 PCX wiFileTypeDCX 5 DCX wiFileTypeJPG 6 JPG wiFileTypeXIF 7 XIF wiFileTypeGIF 8 GIF wiFileTypeWIFF 9 WIFF
Displayed file types of PCX, DCX, JPG, XIF, GIF, or WIFF must be saved using a FileType setting of 1 (TIFF), 2 (AWD), or 3 (BMP). If a multipage image file (AWD, DCX, TIFF, WIFF, or XIF) is saved as a BMP file, only the page currently being displayed is saved to the new file. A file with a .JFX extension is also a TIFF file type. Note: AWD is not available with Imaging for Windows NT 4.0. GIF and WIFF are available with Imaging for Windows Professional Edition V1.0, V1.1, and V2.0; and Imaging for Windows 98.
/gustav
|
|
|
|