Available in the LEADTOOLS Imaging toolkit. |
GetFileInfo example for Access 2.0
This example gets information about the specified file.
' Initialize variables
fname = "c:\lead\images\image1.cmp"
pg =0
' Update the variables
Me![LEAD1].Object.GetFileInfo fname, pg, 0
' Read the updated properties
fmt = Me![LEAD1].Object.InfoFormat
nwidth = Me![LEAD1].Object.InfoWidth
nheight = Me![LEAD1].Object.InfoHeight
bps = Me![LEAD1].Object.InfoBits
xres = Me![LEAD1].Object.BitmapXRes
yres = Me![LEAD1].Object.BitmapYRes
pg = Me![LEAD1].Object.InfoPage
sizd = Me![LEAD1].Object.InfoSizeDisk
sizm = Me![LEAD1].Object.InfoSizeMem
cmp = Me![LEAD1].Object.InfoCompress
' Translate the meaning of the format constant
Select Case fmt
Case FILE_PCX
cFmt = "ZSoft PCX"
Case FILE_GIF
cFmt = "CompuServe GIF"
Case FILE_TGA
cFmt = "TARGA"
Case FILE_PNG
cFmt = "Portable Network Graphics"
Case FILE_PSD
cFmt = "Adobe Photoshop 3.0"
Case FILE_BMP
cFmt = "Windows BMP"
Case FILE_OS2
cFmt = "OS/2 BMP version 1.x"
Case FILE_OS2_2
cFmt = "OS/2 BMP version 2.x"
Case FILE_WMF
cFmt = "Windows Meta File"
Case FILE_EPS
cFmt = "Encapsulated PostScript"
Case FILE_TIF
cFmt = "Tagged Image File Format (TIFF, TIFLZW, or CCITT file)"
Case FILE_TIF_JPEG
cFmt = "Tagged Image File with JPEG compression"
Case FILE_FAX_G3_1D
cFmt = "Raw FAX, compressed using CCITT group 3, 1 dimension"
Case FILE_FAX_G3_2D
cFmt = "Raw FAX, compressed using CCITT group 3, 2 dimensions"
Case FILE_FAX_G4
cFmt = "Raw FAX, compressed using CCITT group 4"
Case FILE_WFX_G3_1D
cFmt = "WinFax, compressed using CCITT group 3, 1 dimension"
Case FILE_WFX_G4
cFmt = "WinFax, compressed using CCITT group 4"
Case FILE_ICA_G3_1D
cFmt = "IOCA, compressed using CCITT group 3, 1 dimension"
Case FILE_ICA_G3_2D
cFmt = "IOCA, compressed using CCITT group 3, 2 dimensions"
Case FILE_ICA_G4
cFmt = "IOCA, compressed using CCITT group 4"
Case FILE_CMP
cFmt = "LEAD proprietary compression format"
Case FILE_CMP_NOLOSS
cFmt = "LEAD lossless compression format"
Case FILE_JPEG
cFmt = "JPEG File Interchange Format"
Case FILE_WPG
cFmt = "WordPerfect"
Case FILE_RAS
cFmt = "Sun Raster"
Case FILE_CALS
cFmt = "CALS Raster"
Case FILE_MAC
cFmt = "MacPaint"
Case FILE_PCT
cFmt = "Macintosh Pict"
Case FILE_MSP
cFmt = "Microsoft Paint"
Case FILE_IMG
cFmt = "GEM Image"
Case FILE_PCD
cFmt = "Kodak PhotoCD"
Case FILE_EPSTIFF
cFmt = "Encapsulated PostScript with an embedded TIFF file"
Case Else
cFmt = "Unknown format"
End Select
' Create the message string
cMsg = fname + CHR(13) + "Page = " + STR(pg) + CHR(13)+ "Format = " + cFmt + CHR(13)
cMsg = cMsg + "Width = " + STR(nwidth) + CHR(13) + "Height = " + STR(nheight) + CHR(13)
cMsg = cMsg + "Size on disk = " + STR(sizd) + CHR(13) + "Size in memory = " + STR(sizm) + CHR(13)
cMsg = cMsg + "Bits per pixel = " + STR(bps) + CHR(13)
cMsg = cMsg + "X resolution = " + STR(xres) + CHR(13) + "Y resolution = " + STR(yres)
' Display the message box
answer = MsgBox(cMsg, 0, "File Info")