(declarations)
In Class PicGIF
1 ' PicInfo GIF file information class
2 ' ©2006 Aivosto Oy (www.aivosto.com)
3 '
4 ' This file is part of a sample project for Project Analyzer.
5 ' Distribution of this file is only allowed along with Project Analyzer
6 ' according to the Project Analyzer license terms.
7
8 Option Explicit
9
10 Implements IPicInfo
11
12 Private StoredFilename As String ' Filename used in the previous call to ReadFile
13
14 ' FileOK is a flag indicating whether a valid GIF file has been read
15 ' True - The variables below contain valid data
16 ' False - The variables below contain undefined data and should not be used
17 Private FileOK As Boolean
18
19 ' Brief introduction to GIF file structure
20 '
21 ' Every GIF file starts with the following bytes:
22 ' 6 bytes for Signature (either GIF87a or GIF89a in ASCII)
23 ' 7 bytes for LogicalScreenDescriptor
24
25 Private Signature As String * 6 ' GIF87a, GIF89a
26
27 Private Type TLogicalScreenDescriptor
28 Width As Integer ' uint - Width, in pixels
29 Height As Integer ' uint - Height, in pixels
30 Packed As Byte ' Byte packed with color information
Type field written, not read: TLogicalScreenDescriptor.BackgroundColorIndex - 0 reads, 1 write
31 BackgroundColorIndex As Byte ' Background Color index to Global Color Table
Type field written, not read: TLogicalScreenDescriptor.PixelAspectRatio - 0 reads, 1 write
32 PixelAspectRatio As Byte ' Approximation of aspect ratio of pixel in the original image
33 End Type
34 Private LogicalScreenDescriptor As TLogicalScreenDescriptor ' Storage for LogicalScreenDescriptor
35 Private MaxColors As Long ' Maximum number of colors in .gif
36