implemented by guessing the 16bit bmp reader part

git-svn-id: trunk@5361 -
This commit is contained in:
mattias 2004-04-02 20:20:21 +00:00
parent c1191c69d0
commit 6dc1f2faec
4 changed files with 112 additions and 117 deletions

View File

@ -3,7 +3,7 @@ object PublishProjectDialog: TPublishProjectDialog
ClientHeight = 462
ClientWidth = 469
OnResize = PublishProjectDialogRESIZE
Position = POSCREENCENTER
Position = poScreenCenter
HorzScrollBar.Page = 470
VertScrollBar.Page = 463
Left = 307
@ -11,10 +11,9 @@ object PublishProjectDialog: TPublishProjectDialog
Top = 165
Width = 469
object OkButton: TButton
Anchors = [AKTOP, AKRIGHT]
Anchors = [akTop, akRight]
ModalResult = 1
Caption = 'Ok'
TabStop = True
TabOrder = 0
OnClick = OkButtonCLICK
Left = 72
@ -23,10 +22,9 @@ object PublishProjectDialog: TPublishProjectDialog
Width = 75
end
object CancelButton: TButton
Anchors = [AKTOP, AKRIGHT]
Anchors = [akTop, akRight]
ModalResult = 2
Caption = 'Cancel'
TabStop = True
TabOrder = 1
Left = 371
Height = 25
@ -49,7 +47,6 @@ object PublishProjectDialog: TPublishProjectDialog
MaxLength = 0
ParentCtl3D = False
TabOrder = 0
TabStop = True
Text = 'DestDirComboBox'
Left = 6
Height = 25
@ -57,13 +54,8 @@ object PublishProjectDialog: TPublishProjectDialog
Width = 350
end
object BrowseDestDirBitBtn: TBitBtn
Glyph.Data = {
3A000000424D3A00000000000000360000002800000001000000010000000100
100000000000040000005A00000060000000400000004000000000000000
}
Spacing = 3
OnClick = BrowseDestDirBitBtnCLICK
Caption = 'Browse'
TabStop = True
TabOrder = 1
OnClick = BrowseDestDirBitBtnCLICK
Left = 366
@ -75,7 +67,6 @@ object PublishProjectDialog: TPublishProjectDialog
MaxLength = 0
ParentCtl3D = False
TabOrder = 2
TabStop = True
Text = 'CommandAfterCombobox'
Left = 6
Height = 25
@ -84,7 +75,6 @@ object PublishProjectDialog: TPublishProjectDialog
end
object CommandAfterLabel: TLabel
Caption = 'Command after:'
Layout = TLTOP
Left = 6
Height = 17
Top = 33
@ -109,7 +99,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Ignore binaries'
DragCursor = 65524
TabOrder = 0
TabStop = True
Left = 6
Height = 20
Top = 1
@ -134,7 +123,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Save editor info of closed files'
DragCursor = 65524
TabOrder = 0
TabStop = True
Left = 4
Height = 20
Top = 1
@ -146,7 +134,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Save editor info of non project files'
DragCursor = 65524
TabOrder = 1
TabStop = True
Left = 4
Height = 20
Top = 26
@ -154,9 +141,8 @@ object PublishProjectDialog: TPublishProjectDialog
end
end
object SaveSettingsButton: TButton
Anchors = [AKTOP, AKRIGHT]
Anchors = [akTop, akRight]
Caption = 'Save settings'
TabStop = True
TabOrder = 5
OnClick = SaveSettingsButtonCLICK
Left = 198
@ -183,7 +169,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Use Include Filter'
DragCursor = 65524
TabOrder = 0
TabStop = True
Left = 6
Height = 20
Top = 1
@ -195,7 +180,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Simple Syntax'
DragCursor = 65524
TabOrder = 1
TabStop = True
Left = 196
Height = 20
Top = 2
@ -205,7 +189,6 @@ object PublishProjectDialog: TPublishProjectDialog
MaxLength = 0
ParentCtl3D = False
TabOrder = 2
TabStop = True
Text = 'IncludeFilterCombobox'
Left = 6
Height = 25
@ -232,7 +215,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Use Exclude Filter'
DragCursor = 65524
TabOrder = 0
TabStop = True
Left = 6
Height = 20
Top = 5
@ -244,7 +226,6 @@ object PublishProjectDialog: TPublishProjectDialog
Caption = 'Simple Syntax'
DragCursor = 65524
TabOrder = 1
TabStop = True
Left = 199
Height = 20
Top = 6
@ -254,7 +235,6 @@ object PublishProjectDialog: TPublishProjectDialog
MaxLength = 0
ParentCtl3D = False
TabOrder = 2
TabStop = True
Text = 'ExcludeFilterCombobox'
Left = 6
Height = 25

View File

@ -3,72 +3,68 @@
LazarusResources.Add('TPublishProjectDialog','FORMDATA',[
'TPF0'#21'TPublishProjectDialog'#20'PublishProjectDialog'#7'Caption'#6#15'Pub'
+'lish Project'#12'ClientHeight'#3#206#1#11'ClientWidth'#3#213#1#8'OnResize'#7
+#26'PublishProjectDialogRESIZE'#8'Position'#7#14'POSCREENCENTER'#18'HorzScro'
+#26'PublishProjectDialogRESIZE'#8'Position'#7#14'poScreenCenter'#18'HorzScro'
+'llBar.Page'#3#214#1#18'VertScrollBar.Page'#3#207#1#4'Left'#3'3'#1#6'Height'
+#3#206#1#3'Top'#3#165#0#5'Width'#3#213#1#0#7'TButton'#8'OkButton'#7'Anchors'
+#11#5'AKTOP'#7'AKRIGHT'#0#11'ModalResult'#2#1#7'Caption'#6#2'Ok'#7'TabStop'#9
+#8'TabOrder'#2#0#7'OnClick'#7#13'OkButtonCLICK'#4'Left'#2'H'#6'Height'#2#25#3
+'Top'#3#176#1#5'Width'#2'K'#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#5
+'AKTOP'#7'AKRIGHT'#0#11'ModalResult'#2#2#7'Caption'#6#6'Cancel'#7'TabStop'#9
+#8'TabOrder'#2#1#4'Left'#3's'#1#6'Height'#2#25#3'Top'#3#176#1#5'Width'#2'K'#0
+#0#9'TGroupBox'#15'DestDirGroupBox'#7'Caption'#6#21'Destination directory'#12
+'ClientHeight'#2'^'#11'ClientWidth'#3#190#1#11'ParentColor'#9#11'ParentCtl3D'
+#8#8'TabOrder'#2#2#8'OnResize'#7#21'DestDirGroupBoxRESIZE'#4'Left'#2#8#6'Hei'
+'ght'#2'o'#3'Top'#2#8#5'Width'#3#194#1#0#9'TComboBox'#15'DestDirComboBox'#9
+'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#0#7'TabStop'#9#4'Text'#6#15
+'DestDirComboBox'#4'Left'#2#6#6'Height'#2#25#3'Top'#2#1#5'Width'#3'^'#1#0#0#7
+'TBitBtn'#19'BrowseDestDirBitBtn'#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0
+#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#16#0#0#0#0#0#4#0#0#0'Z'#0
+#0#0'`'#0#0#0'@'#0#0#0'@'#0#0#0#0#0#0#0#7'Spacing'#2#3#7'Caption'#6#6'Browse'
+#7'TabStop'#9#8'TabOrder'#2#1#7'OnClick'#7#24'BrowseDestDirBitBtnCLICK'#4'Le'
+'ft'#3'n'#1#6'Height'#2#25#3'Top'#2#1#5'Width'#2'H'#0#0#9'TComboBox'#20'Comm'
+'andAfterCombobox'#9'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#2#7'TabS'
+'top'#9#4'Text'#6#20'CommandAfterCombobox'#4'Left'#2#6#6'Height'#2#25#3'Top'
+#2':'#5'Width'#3#174#1#0#0#6'TLabel'#17'CommandAfterLabel'#7'Caption'#6#14'C'
+'ommand after:'#6'Layout'#7#5'TLTOP'#4'Left'#2#6#6'Height'#2#17#3'Top'#2'!'#5
+'Width'#3#172#1#0#0#0#9'TGroupBox'#13'FilesGroupbox'#7'Caption'#6#5'Files'#12
+'ClientHeight'#2#27#11'ClientWidth'#3#190#1#11'ParentColor'#9#11'ParentCtl3D'
+#8#8'TabOrder'#2#3#8'OnResize'#7#19'FilesGroupboxRESIZE'#4'Left'#2#8#6'Heigh'
+'t'#2','#3'Top'#3#128#0#5'Width'#3#194#1#0#9'TCheckBox'#22'IgnoreBinariesChe'
+'ckbox'#11'AllowGrayed'#9#8'AutoSize'#9#7'Caption'#6#15'Ignore binaries'#10
+'DragCursor'#4#244#255#0#0#8'TabOrder'#2#0#7'TabStop'#9#4'Left'#2#6#6'Height'
+#2#20#3'Top'#2#1#5'Width'#3#161#0#0#0#0#9'TGroupBox'#19'ProjectInfoGroupbox'
+#7'Caption'#6#19'Project Information'#12'ClientHeight'#2'4'#11'ClientWidth'#3
+#190#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#4#8'OnResize'#7#25
+'ProjectInfoGroupboxRESIZE'#4'Left'#2#8#6'Height'#2'E'#3'Top'#3'X'#1#5'Width'
+#3#194#1#0#9'TCheckBox!SaveClosedEditorFilesInfoCheckbox'#11'AllowGrayed'#9#8
+'AutoSize'#9#7'Caption'#6' Save editor info of closed files'#10'DragCursor'#4
+#244#255#0#0#8'TabOrder'#2#0#7'TabStop'#9#4'Left'#2#4#6'Height'#2#20#3'Top'#2
+#11#5'akTop'#7'akRight'#0#11'ModalResult'#2#1#7'Caption'#6#2'Ok'#8'TabOrder'
+#2#0#7'OnClick'#7#13'OkButtonCLICK'#4'Left'#2'H'#6'Height'#2#25#3'Top'#3#176
+#1#5'Width'#2'K'#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11#5'akTop'#7'ak'
+'Right'#0#11'ModalResult'#2#2#7'Caption'#6#6'Cancel'#8'TabOrder'#2#1#4'Left'
+#3's'#1#6'Height'#2#25#3'Top'#3#176#1#5'Width'#2'K'#0#0#9'TGroupBox'#15'Dest'
+'DirGroupBox'#7'Caption'#6#21'Destination directory'#12'ClientHeight'#2'^'#11
+'ClientWidth'#3#190#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#2#8
+'OnResize'#7#21'DestDirGroupBoxRESIZE'#4'Left'#2#8#6'Height'#2'o'#3'Top'#2#8
+#5'Width'#3#194#1#0#9'TComboBox'#15'DestDirComboBox'#9'MaxLength'#2#0#11'Par'
+'entCtl3D'#8#8'TabOrder'#2#0#4'Text'#6#15'DestDirComboBox'#4'Left'#2#6#6'Hei'
+'ght'#2#25#3'Top'#2#1#5'Width'#3'^'#1#0#0#7'TBitBtn'#19'BrowseDestDirBitBtn'
+#7'OnClick'#7#24'BrowseDestDirBitBtnCLICK'#7'Caption'#6#6'Browse'#8'TabOrder'
+#2#1#7'OnClick'#7#24'BrowseDestDirBitBtnCLICK'#4'Left'#3'n'#1#6'Height'#2#25
+#3'Top'#2#1#5'Width'#2'H'#0#0#9'TComboBox'#20'CommandAfterCombobox'#9'MaxLen'
+'gth'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#2#4'Text'#6#20'CommandAfterCombobo'
+'x'#4'Left'#2#6#6'Height'#2#25#3'Top'#2':'#5'Width'#3#174#1#0#0#6'TLabel'#17
+'CommandAfterLabel'#7'Caption'#6#14'Command after:'#4'Left'#2#6#6'Height'#2
+#17#3'Top'#2'!'#5'Width'#3#172#1#0#0#0#9'TGroupBox'#13'FilesGroupbox'#7'Capt'
+'ion'#6#5'Files'#12'ClientHeight'#2#27#11'ClientWidth'#3#190#1#11'ParentColo'
+'r'#9#11'ParentCtl3D'#8#8'TabOrder'#2#3#8'OnResize'#7#19'FilesGroupboxRESIZE'
+#4'Left'#2#8#6'Height'#2','#3'Top'#3#128#0#5'Width'#3#194#1#0#9'TCheckBox'#22
+'IgnoreBinariesCheckbox'#11'AllowGrayed'#9#8'AutoSize'#9#7'Caption'#6#15'Ign'
+'ore binaries'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2#0#4'Left'#2#6#6'He'
+'ight'#2#20#3'Top'#2#1#5'Width'#3#161#0#0#0#0#9'TGroupBox'#19'ProjectInfoGro'
+'upbox'#7'Caption'#6#19'Project Information'#12'ClientHeight'#2'4'#11'Client'
+'Width'#3#190#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#4#8'OnResi'
+'ze'#7#25'ProjectInfoGroupboxRESIZE'#4'Left'#2#8#6'Height'#2'E'#3'Top'#3'X'#1
+#5'Width'#3#194#1#0#9'TCheckBox!SaveClosedEditorFilesInfoCheckbox'#11'AllowG'
+'rayed'#9#8'AutoSize'#9#7'Caption'#6' Save editor info of closed files'#10'D'
+'ragCursor'#4#244#255#0#0#8'TabOrder'#2#0#4'Left'#2#4#6'Height'#2#20#3'Top'#2
+#1#5'Width'#3#176#1#0#0#9'TCheckBox''SaveEditorInfoOfNonProjectFilesCheckbox'
+#11'AllowGrayed'#9#8'AutoSize'#9#7'Caption'#6'%Save editor info of non proje'
+'ct files'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2#1#7'TabStop'#9#4'Left'
+#2#4#6'Height'#2#20#3'Top'#2#26#5'Width'#3#176#1#0#0#0#7'TButton'#18'SaveSet'
+'tingsButton'#7'Anchors'#11#5'AKTOP'#7'AKRIGHT'#0#7'Caption'#6#13'Save setti'
+'ngs'#7'TabStop'#9#8'TabOrder'#2#5#7'OnClick'#7#23'SaveSettingsButtonCLICK'#4
+'Left'#3#198#0#6'Height'#2#25#3'Top'#3#176#1#5'Width'#2'x'#0#0#9'TGroupBox'
+#21'IncludeFilterGroupbox'#7'Caption'#6#14'Include Filter'#12'ClientHeight'#2
+':'#11'ClientWidth'#3#190#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2
+#6#7'TabStop'#9#8'OnResize'#7#27'IncludeFilterGroupboxRESIZE'#4'Left'#2#8#6
+'Height'#2'K'#3'Top'#3#176#0#5'Width'#3#194#1#0#9'TCheckBox'#24'UseIncludeFi'
+'lterCheckbox'#11'AllowGrayed'#9#8'AutoSize'#9#7'Caption'#6#18'Use Include F'
+'ilter'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2#0#7'TabStop'#9#4'Left'#2#6
+#6'Height'#2#20#3'Top'#2#1#5'Width'#3#171#0#0#0#9'TCheckBox'#29'IncFilterSim'
+'pleSyntaxCheckbox'#11'AllowGrayed'#9#8'AutoSize'#9#7'Caption'#6#13'Simple S'
+'yntax'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2#1#7'TabStop'#9#4'Left'#3
+#196#0#6'Height'#2#20#3'Top'#2#2#5'Width'#3#201#0#0#0#9'TComboBox'#21'Includ'
+'eFilterCombobox'#9'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabOrder'#2#2#7'TabSt'
+'op'#9#4'Text'#6#21'IncludeFilterCombobox'#4'Left'#2#6#6'Height'#2#25#3'Top'
+#2#25#5'Width'#3#174#1#0#0#0#9'TGroupBox'#21'ExcludeFilterGroupbox'#7'Captio'
+'n'#6#14'Exclude Filter'#12'ClientHeight'#2'>'#11'ClientWidth'#3#188#1#11'Pa'
+'rentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#7#7'TabStop'#9#8'OnResize'#7#27
+'ExcludeFilterGroupboxRESIZE'#4'Left'#2#8#6'Height'#2'O'#3'Top'#3#0#1#5'Widt'
+'h'#3#192#1#0#9'TCheckBox'#24'UseExcludeFilterCheckbox'#11'AllowGrayed'#9#8
+'AutoSize'#9#7'Caption'#6#18'Use Exclude Filter'#10'DragCursor'#4#244#255#0#0
+#8'TabOrder'#2#0#7'TabStop'#9#4'Left'#2#6#6'Height'#2#20#3'Top'#2#5#5'Width'
,#3#151#0#0#0#9'TCheckBox'#29'ExcFilterSimpleSyntaxCheckbox'#11'AllowGrayed'#9
+#8'AutoSize'#9#7'Caption'#6#13'Simple Syntax'#10'DragCursor'#4#244#255#0#0#8
+'TabOrder'#2#1#7'TabStop'#9#4'Left'#3#199#0#6'Height'#2#20#3'Top'#2#6#5'Widt'
+'h'#3#212#0#0#0#9'TComboBox'#21'ExcludeFilterCombobox'#9'MaxLength'#2#0#11'P'
+'arentCtl3D'#8#8'TabOrder'#2#2#7'TabStop'#9#4'Text'#6#21'ExcludeFilterCombob'
+'ox'#4'Left'#2#6#6'Height'#2#25#3'Top'#2#30#5'Width'#3#174#1#0#0#0#0
+'ct files'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2#1#4'Left'#2#4#6'Height'
+#2#20#3'Top'#2#26#5'Width'#3#176#1#0#0#0#7'TButton'#18'SaveSettingsButton'#7
+'Anchors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#13'Save settings'#8'TabOrder'
+#2#5#7'OnClick'#7#23'SaveSettingsButtonCLICK'#4'Left'#3#198#0#6'Height'#2#25
+#3'Top'#3#176#1#5'Width'#2'x'#0#0#9'TGroupBox'#21'IncludeFilterGroupbox'#7'C'
+'aption'#6#14'Include Filter'#12'ClientHeight'#2':'#11'ClientWidth'#3#190#1
+#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#6#7'TabStop'#9#8'OnResize'
+#7#27'IncludeFilterGroupboxRESIZE'#4'Left'#2#8#6'Height'#2'K'#3'Top'#3#176#0
+#5'Width'#3#194#1#0#9'TCheckBox'#24'UseIncludeFilterCheckbox'#11'AllowGrayed'
+#9#8'AutoSize'#9#7'Caption'#6#18'Use Include Filter'#10'DragCursor'#4#244#255
+#0#0#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#20#3'Top'#2#1#5'Width'#3#171#0#0
+#0#9'TCheckBox'#29'IncFilterSimpleSyntaxCheckbox'#11'AllowGrayed'#9#8'AutoSi'
+'ze'#9#7'Caption'#6#13'Simple Syntax'#10'DragCursor'#4#244#255#0#0#8'TabOrde'
+'r'#2#1#4'Left'#3#196#0#6'Height'#2#20#3'Top'#2#2#5'Width'#3#201#0#0#0#9'TCo'
+'mboBox'#21'IncludeFilterCombobox'#9'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabO'
+'rder'#2#2#4'Text'#6#21'IncludeFilterCombobox'#4'Left'#2#6#6'Height'#2#25#3
+'Top'#2#25#5'Width'#3#174#1#0#0#0#9'TGroupBox'#21'ExcludeFilterGroupbox'#7'C'
+'aption'#6#14'Exclude Filter'#12'ClientHeight'#2'>'#11'ClientWidth'#3#188#1
+#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#7#7'TabStop'#9#8'OnResize'
+#7#27'ExcludeFilterGroupboxRESIZE'#4'Left'#2#8#6'Height'#2'O'#3'Top'#3#0#1#5
+'Width'#3#192#1#0#9'TCheckBox'#24'UseExcludeFilterCheckbox'#11'AllowGrayed'#9
+#8'AutoSize'#9#7'Caption'#6#18'Use Exclude Filter'#10'DragCursor'#4#244#255#0
+#0#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#20#3'Top'#2#5#5'Width'#3#151#0#0#0
+#9'TCheckBox'#29'ExcFilterSimpleSyntaxCheckbox'#11'AllowGrayed'#9#8'AutoSize'
+#9#7'Caption'#6#13'Simple Syntax'#10'DragCursor'#4#244#255#0#0#8'TabOrder'#2
+#1#4'Left'#3#199#0#6'Height'#2#20#3'Top'#2#6#5'Width'#3#212#0#0#0#9'TComboBo'
+'x'#21'ExcludeFilterCombobox'#9'MaxLength'#2#0#11'ParentCtl3D'#8#8'TabOrder'
,#2#2#4'Text'#6#21'ExcludeFilterCombobox'#4'Left'#2#6#6'Height'#2#25#3'Top'#2
+#30#5'Width'#3#174#1#0#0#0#0
]);

View File

@ -120,7 +120,7 @@ begin
Widget:=GetStyleWidget(lgsVerticalScrollbar);
MinWidth:=Widget^.requisition.Width;
end;
writeln('TGtkWidgetSet.GetControlConstraints A ',MinWidth,',',MinHeight,' ',TScrollBar(SizeConstraints.Control).Kind=sbHorizontal,' ',TScrollBar(SizeConstraints.Control).Name);
//writeln('TGtkWidgetSet.GetControlConstraints A ',MinWidth,',',MinHeight,' ',TScrollBar(SizeConstraints.Control).Kind=sbHorizontal,' ',TScrollBar(SizeConstraints.Control).Name);
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
MinWidth,MinHeight);
end;
@ -463,6 +463,9 @@ end;
{ =============================================================================
$Log$
Revision 1.26 2004/04/02 20:20:21 mattias
implemented by guessing the 16bit bmp reader part
Revision 1.25 2004/03/30 20:38:14 mattias
fixed interface constraints, fixed syncompletion colors

View File

@ -327,7 +327,7 @@ type
ReadSize: Integer; // Size (in bytes) of 1 scanline.
BFI: TBitMapInfoHeader; // The header as read from the stream.
FPalette: PFPcolor; // Buffer with Palette entries.
LineBuf: PByte; // Buffer for 1 scanline. Can be Byte, TColorRGB or TColorRGBA
LineBuf: PByte; // Buffer for 1 scanline. Can be Byte, Word, TColorRGB or TColorRGBA
// SetupRead will allocate the needed buffers, and read the colormap if needed.
procedure SetupRead(nPalette, nRowBits: Integer; Stream: TStream); virtual;
@ -528,11 +528,11 @@ begin
PrecMask:=(Cardinal(1) shl Prec)-1;
P:=@(TheData[Position.Byte]);
{$ifdef Endian_Little}
{$ifdef Endian_Little}
FourBytes:=DWord(PWord(P)^) or (DWord((P+2)^) shl 16);
{$else}
{$else}
FourBytes:=(DWord(PWord(P)^) shl 8) or DWord(P^);
{$endif}
{$endif}
Bits:=Word(cardinal(FourBytes shr Shift) and PrecMask);
if Prec<16 then begin
@ -554,11 +554,11 @@ begin
PrecMask:=(Cardinal(1) shl Prec)-1;
P:=@(TheData[Position.Byte]);
{$ifdef Endian_Little}
{$ifdef Endian_Little}
FourBytes:=(DWord(PWord(P)^) shl 8) or DWord(P^);
{$else}
{$else}
FourBytes:=DWord(PWord(P)^) or (DWord((P+2)^) shl 16);
{$endif}
{$endif}
Bits:=Word(cardinal(FourBytes shr Shift) and PrecMask);
@ -2895,6 +2895,21 @@ begin
end;
end;
Function Bmp16BitToFPColor(Const RGB: Word): TFPColor;
begin
// 5 bit for red -> 16 bit for TFPColor
Result.Red:=(RGB shr 11) and $1f;
Result.Red:=(Result.Red shl 11) or MissingBits[5,Result.Red shr 2];
// 6 bit for green -> 16 bit for TFPColor
Result.Green:=(RGB shr 5) and $3f;
Result.Green:=(Result.Green shl 10) or MissingBits[6,Result.Green shr 3];
// 5 bit for blue -> 16 bit for TFPColor
Result.Blue:=RGB and $1f;
Result.Blue:=(Result.Red shl 11) or MissingBits[5,Result.Blue shr 2];
// opaque, no mask
Result.Alpha:=alphaOpaque;
end;
procedure TLazReaderBMP.FreeBufs;
begin
If (LineBuf<>Nil) then
@ -2925,7 +2940,7 @@ begin
if nPalette>0 then
begin
GetMem(FPalette, nPalette*SizeOf(TFPColor));
{$ifdef VER1_0}
{$ifdef VER1_0}
GetMem(ColInfo, nPalette*Sizeof(TColorBmpRGBA));
if BFI.biClrUsed>0 then
Stream.Read(ColInfo^[0],BFI.biClrUsed*SizeOf(TColorBmpRGBA))
@ -2933,7 +2948,7 @@ begin
Stream.Read(ColInfo^[0],nPalette*SizeOf(TColorBmpRGBA));
for i := 0 to nPalette-1 do
FPalette[i] := BmpRGBAToFPColor(ColInfo^[i]);
{$else}
{$else}
SetLength(ColInfo, nPalette);
if BFI.biClrUsed>0 then
Stream.Read(ColInfo[0],BFI.biClrUsed*SizeOf(TColorBmpRGBA))
@ -2941,16 +2956,16 @@ begin
Stream.Read(ColInfo[0],nPalette*SizeOf(TColorBmpRGBA));
for i := 0 to High(ColInfo) do
FPalette[i] := BmpRGBAToFPColor(ColInfo[i]);
{$endif}
{$endif}
end
else if BFI.biClrUsed>0 then { Skip palette }
Stream.Position := Stream.Position
+ TStreamSeekType(BFI.biClrUsed*SizeOf(TColorBmpRGBA));
ReadSize:=((nRowBits + 31) div 32) shl 2;
GetMem(LineBuf,ReadSize);
{$ifdef VER1_0}
FreeMem(ColInfo, nPalette*Sizeof(TColorBmpRGBA));
{$endif}
{$ifdef VER1_0}
FreeMem(ColInfo, nPalette*Sizeof(TColorBmpRGBA));
{$endif}
end;
procedure TLazReaderBMP.ReadScanLine(Row: Integer; Stream: TStream);
@ -2979,7 +2994,8 @@ begin
for Column:=0 to img.Width-1 do
img.colors[Column,Row]:=FPalette[LineBuf[Column]];
16 :
Raise FPImageException.Create('16 bpp bitmaps not supported');
for Column:=0 to img.Width-1 do
img.colors[Column,Row]:=Bmp16BitToFPColor(PWord(LineBuf)[Column]);
24 :
for Column:=0 to img.Width-1 do
img.colors[Column,Row]:=BmpRGBToFPColor(PColorBmpRGB(LineBuf)[Column]);
@ -3011,7 +3027,7 @@ begin
8 :
SetupRead(256,Img.Width*8,Stream);
16 :
Raise FPImageException.Create('16 bpp bitmaps not supported');
SetupRead(0,Img.Width*8*2,Stream);
24:
SetupRead(0,Img.Width*8*3,Stream);
32:
@ -3048,18 +3064,6 @@ begin
inherited Destroy;
end;
//------------------------------------------------------------------------------
procedure InternalInit;
var
c: Char;
begin
for c:=Low(char) to High(char) do begin
IsSpaceChar[c]:=c in [' ',#9,#10,#13];
IsNumberChar[c]:=c in ['0'..'9'];
IsHexNumberChar[c]:=c in ['0'..'9','A'..'F','a'..'f'];
end;
end;
{ TLazIntfImageMask }
procedure TLazIntfImageMask.SetInternalColor(x, y: integer;
@ -3099,6 +3103,18 @@ begin
inherited Create(FImage.Width,FImage.Height);
end;
//------------------------------------------------------------------------------
procedure InternalInit;
var
c: Char;
begin
for c:=Low(char) to High(char) do begin
IsSpaceChar[c]:=c in [' ',#9,#10,#13];
IsNumberChar[c]:=c in ['0'..'9'];
IsHexNumberChar[c]:=c in ['0'..'9','A'..'F','a'..'f'];
end;
end;
initialization
InternalInit;