@@ -13,8 +13,8 @@ Import BRL.Stream
13
13
Import BRL.EndianStream
14
14
15
15
'Version
16
- Global appVersion:String = " 1.2"
17
- Global appVersionDate:String = " 21 Sep 2019"
16
+ Global appVersion:String = " 1.2.1 "
17
+ Global appVersionDate:String = " 22 Sep 2019"
18
18
19
19
Rem
20
20
------- INDEXING ------------------------------------------------------------------------------------------------------
@@ -73,9 +73,8 @@ Type TBitmapIndex
73
73
74
74
WriteShort(dataStream,19778 ) 'File ID (2 bytes (short)) - 19778 (deci) or 42 4D (hex) or BM (ascii) for bitmap
75
75
WriteInt(dataStream,bmpSizeTotalM4) 'File Size (4 bytes (signed int))
76
- WriteShort(dataStream,0 ) 'Reserved (2 bytes)
77
- WriteShort(dataStream,0 ) 'Reserved (2 bytes)
78
- WriteInt(dataStream,54 ) 'Pixel Array Offset (4 bytes) - pixel array starts at 54th byte
76
+ WriteInt(dataStream,0 ) 'Reserved (4 bytes)
77
+ WriteInt(dataStream,1078 ) 'Pixel Array Offset (4 bytes) - pixel array starts at 1078th byte (14 bytes Header + 40 bytes DIB + 1024 (256 * 4) bytes Color Table)
79
78
80
79
'------ DIB Header (File Info)
81
80
WriteInt(dataStream,40 ) 'DIB Header Size (4 bytes) - 40 bytes
@@ -92,10 +91,14 @@ Type TBitmapIndex
92
91
93
92
'------ Color Table
94
93
For paletteIndex = 0 To 255
95
- WriteByte(dataStream,palB[ paletteIndex] ) 'Blue (4 bytes) - offset 54
96
- WriteByte(dataStream,palG[ paletteIndex] ) 'Green (4 bytes) - offset 58
97
- WriteByte(dataStream,palR[ paletteIndex] ) 'Red (4 bytes) - offset 62
98
- WriteByte(dataStream,0 ) 'Alpha (4 bytes) - offset 66
94
+ WriteByte(dataStream,palB[ paletteIndex] ) 'Blue (1 byte)
95
+ WriteByte(dataStream,palG[ paletteIndex] ) 'Green (1 byte)
96
+ WriteByte(dataStream,palR[ paletteIndex] ) 'Red (1 byte)
97
+ WriteByte(dataStream,0 ) 'Reserved (1 byte) - Alpha channel, irrelevant for indexed bitmaps
98
+
99
+ Rem
100
+ Color Table is 4 bytes (ARGB) times the amount of colors in the palette
101
+ EndRem
99
102
Next
100
103
101
104
'------ Pixel Array
0 commit comments