* Type variables must be defined in every SUB or FUNCTION unless the type variable is [[DIM]]ensioned as [[SHARED]].
* Type variables use DOT variable names to read or write specific values. They do not use type suffixes as they can hold ANY variable type values! The name before the dot is the one you defined after the type definition and the name after is the variable name used inside of the TYPE. The name of the dimensioned type variable alone can be used to [[PUT]] # or [[GET]] # all of the data at once!
* Once the TYPE variable is created you can find the record or byte size by using [[LEN]](typevariable).
* TYPE definitions can also be placed in [[$INCLUDE]] .BI text files such as [[QB.BI]] is used by [[INTERRUPT]] and [[INTERRUPTX]].
PWidth AS LONG ' Image width 4 {{Cl|_WIDTH (QB64)}}
PDepth AS LONG ' Image height 4 {{Cl|_HEIGHT}}
Planes AS INTEGER ' Number of planes 2
BPP AS INTEGER ' Bits per pixel(palette) 2 {{Cl|_PIXELSIZE}}
Compress AS LONG ' Compression 4
ImageBytes AS LONG ' Width * Height = ImageSIZE 4
Xres AS LONG ' Width in PELS per metre 4
Yres AS LONG ' Depth in PELS per metre 4
NumColors AS LONG ' Number of Colors 4
SigColors AS LONG ' Significant Colors 4
END TYPE ' Total Header bytes = 54 '' ''
{{TextEnd}}
{{CodeStart}}
'{{Cl|$INCLUDE}}: 'Bitmap.BI' 'use only when including a BI file
{{Cl|DIM}} {{Cl|SHARED}} BMPHead AS BMPHeaderType
{{Cl|GET|GET #}}1, , BMPHead 'get the entire bitmap header information
{{CodeEnd}}
:''Explanation:'' Use one [[GET]] to read all of the header information from the start of the bitmap file opened AS [[BINARY]]. It reads all 54 bytes as [[STRING]], [[INTEGER]] and [[LONG]] type DOT variable values.
:The bitmap image is now stored in an {{KW|Arrays|array}} to {{KW|BSAVE}} to a file. The RGB color information follows the file header as [[ASCII]] character values read using {{KW|ASC}}. The color values could be indexed at the start of the Array with the image being offset to: index = NumberOfColors * 3. As determined by the {{KW|SCREEN (statement)|SCREEN}} mode used. In SCREEN 13(256 colors) the index would be 768.