ImagesForLazarus: fix the example so it compiles and runs

git-svn-id: trunk@42160 -
This commit is contained in:
juha 2013-07-20 17:56:54 +00:00
parent 7b2d487b16
commit d1794b7b1c
4 changed files with 85 additions and 84 deletions

View File

@ -1,15 +1,18 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/> <Version Value="9"/>
<Version Value="5"/>
<General> <General>
<Flags>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/>
<Title Value="Images Example"/> <Title Value="Images Example"/>
</General> </General>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/> <IgnoreBinaries Value="False"/>
@ -39,9 +42,10 @@
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="mainform.pas"/> <Filename Value="mainform.pas"/>
<ComponentName Value="ImagesExampleForm"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ResourceFilename Value="mainform.lrs"/> <ComponentName Value="ImagesExampleForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="MainForm"/> <UnitName Value="MainForm"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
@ -51,17 +55,19 @@
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="11"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="$(LazarusDir)/components/units/$(TargetCPU)/$(TargetOS)/"/> <OtherUnitFiles Value="$(LazarusDir)/components/units/$(TargetCPU)/$(TargetOS)"/>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <Parsing>
<Generate Value="Faster"/> <SyntaxOptions>
</CodeGeneration> <UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking> <Linking>
<Debugging> <Debugging>
<GenerateDebugInfo Value="True"/> <DebugInfoType Value="dsStabs"/>
</Debugging> </Debugging>
</Linking> </Linking>
<Other> <Other>

View File

@ -1,85 +1,83 @@
object ImagesExampleForm: TImagesExampleForm object ImagesExampleForm: TImagesExampleForm
Caption = 'Example for package "Images For Lazarus"'
ClientHeight = 416
ClientWidth = 425
PixelsPerInch = 95
HorzScrollBar.Page = 426
VertScrollBar.Page = 417
Left = 516 Left = 516
Height = 416 Height = 416
Top = 160 Top = 160
Width = 425 Width = 425
HorzScrollBar.Page = 426
VertScrollBar.Page = 417
Caption = 'Example for package "Images For Lazarus"'
ClientHeight = 416
ClientWidth = 425
LCLVersion = '1.1'
object ImageGroupBox: TGroupBox object ImageGroupBox: TGroupBox
Left = 0
Height = 336
Top = 0
Width = 425
Align = alTop Align = alTop
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
Caption = '...' Caption = '...'
ClientHeight = 315 ClientHeight = 317
ClientWidth = 421 ClientWidth = 421
ParentColor = True
ParentCtl3D = False
TabOrder = 0 TabOrder = 0
Height = 336
Width = 425
object Image1: TImage object Image1: TImage
Left = 0
Height = 317
Top = 0
Width = 421
Align = alClient Align = alClient
AutoSize = True AutoSize = True
Center = True Center = True
Transparent = True Transparent = True
Height = 315
Width = 421
end end
end end
object LoadJPEGButton: TButton object LoadJPEGButton: TButton
Left = 229
Height = 25
Top = 346
Width = 173
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
Caption = 'Load JPEG from file' Caption = 'Load JPEG from file'
OnClick = LoadJPEGButtonClick OnClick = LoadJPEGButtonClick
TabOrder = 1 TabOrder = 1
Left = 229
Height = 25
Top = 346
Width = 173
end end
object SaveJPEGButton: TButton object SaveJPEGButton: TButton
Left = 229
Height = 25
Top = 380
Width = 173
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
Caption = 'Save as JPEG to file' Caption = 'Save as JPEG to file'
OnClick = SaveJPEGButtonClick OnClick = SaveJPEGButtonClick
TabOrder = 2 TabOrder = 2
Left = 229
Height = 25
Top = 380
Width = 173
end end
object LoadImageButton: TButton object LoadImageButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'Load Image'
OnClick = LoadImageButtonClick
TabOrder = 3
Left = 24 Left = 24
Height = 25 Height = 25
Top = 346 Top = 346
Width = 163 Width = 163
Anchors = [akLeft, akBottom]
Caption = 'Load Image'
OnClick = LoadImageButtonClick
TabOrder = 3
end end
object SaveImageButton: TButton object SaveImageButton: TButton
Anchors = [akLeft, akBottom]
Caption = 'Save Image'
OnClick = SaveImageButtonClick
TabOrder = 4
Left = 24 Left = 24
Height = 25 Height = 25
Top = 380 Top = 380
Width = 163 Width = 163
Anchors = [akLeft, akBottom]
Caption = 'Save Image'
OnClick = SaveImageButtonClick
TabOrder = 4
end end
object OpenPictureDialog1: TOpenPictureDialog object OpenPictureDialog1: TOpenPictureDialog
Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'
Title = 'Open existing file'
Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp' Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'
FilterIndex = 0 FilterIndex = 0
left = 88 left = 88
top = 64 top = 64
end end
object SavePictureDialog1: TSavePictureDialog object SavePictureDialog1: TSavePictureDialog
Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'
Title = 'Save file as'
Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp' Filter = 'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'
FilterIndex = 0 FilterIndex = 0
left = 88 left = 88

View File

@ -1,34 +1,31 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TImagesExampleForm','FORMDATA',[ LazarusResources.Add('TImagesExampleForm','FORMDATA',[
'TPF0'#18'TImagesExampleForm'#17'ImagesExampleForm'#7'Caption'#6'(Example for' 'TPF0'#18'TImagesExampleForm'#17'ImagesExampleForm'#4'Left'#3#4#2#6'Height'#3
+' package "Images For Lazarus"'#12'ClientHeight'#3#160#1#11'ClientWidth'#3 +#160#1#3'Top'#3#160#0#5'Width'#3#169#1#18'HorzScrollBar.Page'#3#170#1#18'Ver'
+#169#1#13'PixelsPerInch'#2'_'#18'HorzScrollBar.Page'#3#170#1#18'VertScrollBa' +'tScrollBar.Page'#3#161#1#7'Caption'#6'(Example for package "Images For Laza'
+'r.Page'#3#161#1#4'Left'#3#4#2#6'Height'#3#160#1#3'Top'#3#160#0#5'Width'#3 +'rus"'#12'ClientHeight'#3#160#1#11'ClientWidth'#3#169#1#10'LCLVersion'#6#3'1'
+#169#1#0#9'TGroupBox'#13'ImageGroupBox'#5'Align'#7#5'alTop'#7'Anchors'#11#5 +'.1'#0#9'TGroupBox'#13'ImageGroupBox'#4'Left'#2#0#6'Height'#3'P'#1#3'Top'#2#0
+'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#3'...'#12'ClientHeight'#3';'#1 +#5'Width'#3#169#1#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akB'
+#11'ClientWidth'#3#165#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#0 +'ottom'#0#7'Caption'#6#3'...'#12'ClientHeight'#3'='#1#11'ClientWidth'#3#165#1
+#6'Height'#3'P'#1#5'Width'#3#169#1#0#6'TImage'#6'Image1'#5'Align'#7#8'alClie' +#8'TabOrder'#2#0#0#6'TImage'#6'Image1'#4'Left'#2#0#6'Height'#3'='#1#3'Top'#2
+'nt'#8'AutoSize'#9#6'Center'#9#11'Transparent'#9#6'Height'#3';'#1#5'Width'#3 +#0#5'Width'#3#165#1#5'Align'#7#8'alClient'#8'AutoSize'#9#6'Center'#9#11'Tran'
+#165#1#0#0#0#7'TButton'#14'LoadJPEGButton'#7'Anchors'#11#6'akLeft'#8'akBotto' +'sparent'#9#0#0#0#7'TButton'#14'LoadJPEGButton'#4'Left'#3#229#0#6'Height'#2
+'m'#0#7'Caption'#6#19'Load JPEG from file'#7'OnClick'#7#19'LoadJPEGButtonCli' +#25#3'Top'#3'Z'#1#5'Width'#3#173#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'C'
+'ck'#8'TabOrder'#2#1#4'Left'#3#229#0#6'Height'#2#25#3'Top'#3'Z'#1#5'Width'#3 +'aption'#6#19'Load JPEG from file'#7'OnClick'#7#19'LoadJPEGButtonClick'#8'Ta'
+#173#0#0#0#7'TButton'#14'SaveJPEGButton'#7'Anchors'#11#6'akLeft'#8'akBottom' +'bOrder'#2#1#0#0#7'TButton'#14'SaveJPEGButton'#4'Left'#3#229#0#6'Height'#2#25
+#0#7'Caption'#6#20'Save as JPEG to file'#7'OnClick'#7#19'SaveJPEGButtonClick' +#3'Top'#3'|'#1#5'Width'#3#173#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Capt'
+#8'TabOrder'#2#2#4'Left'#3#229#0#6'Height'#2#25#3'Top'#3'|'#1#5'Width'#3#173 +'ion'#6#20'Save as JPEG to file'#7'OnClick'#7#19'SaveJPEGButtonClick'#8'TabO'
+#0#0#0#7'TButton'#15'LoadImageButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7 +'rder'#2#2#0#0#7'TButton'#15'LoadImageButton'#4'Left'#2#24#6'Height'#2#25#3
+'Caption'#6#10'Load Image'#7'OnClick'#7#20'LoadImageButtonClick'#8'TabOrder' +'Top'#3'Z'#1#5'Width'#3#163#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Captio'
+#2#3#4'Left'#2#24#6'Height'#2#25#3'Top'#3'Z'#1#5'Width'#3#163#0#0#0#7'TButto' +'n'#6#10'Load Image'#7'OnClick'#7#20'LoadImageButtonClick'#8'TabOrder'#2#3#0
+'n'#15'SaveImageButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#10 +#0#7'TButton'#15'SaveImageButton'#4'Left'#2#24#6'Height'#2#25#3'Top'#3'|'#1#5
+'Save Image'#7'OnClick'#7#20'SaveImageButtonClick'#8'TabOrder'#2#4#4'Left'#2 +'Width'#3#163#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#10'Save I'
+#24#6'Height'#2#25#3'Top'#3'|'#1#5'Width'#3#163#0#0#0#18'TOpenPictureDialog' +'mage'#7'OnClick'#7#20'SaveImageButtonClick'#8'TabOrder'#2#4#0#0#18'TOpenPic'
+#18'OpenPictureDialog1'#6'Filter'#6#143'All files (*)|*|Graphic (*.png;*.xpm' +'tureDialog'#18'OpenPictureDialog1'#6'Filter'#6#143'All files (*)|*|Graphic '
+';*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.' +'(*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.pn'
+'xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'#5'Title'#6#18'Open existing file'#6'Filte' +'g|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'#11'FilterIndex'#2#0#4'left'#2
+'r'#6#143'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Port' +'X'#3'top'#2'@'#0#0#18'TSavePictureDialog'#18'SavePictureDialog1'#6'Filter'#6
+'able Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.b'
+'mp'#11'FilterIndex'#2#0#4'left'#2'X'#3'top'#2'@'#0#0#18'TSavePictureDialog'
+#18'SavePictureDialog1'#6'Filter'#6#143'All files (*)|*|Graphic (*.png;*.xpm'
+';*.bmp)|*.png;*.xpm;*.bmp|Portable Network Graphic (*.png)|*.png|Pixmap (*.'
+'xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'#5'Title'#6#12'Save file as'#6'Filter'#6
+#143'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable ' +#143'All files (*)|*|Graphic (*.png;*.xpm;*.bmp)|*.png;*.xpm;*.bmp|Portable '
+'Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'#11 +'Network Graphic (*.png)|*.png|Pixmap (*.xpm)|*.xpm|Bitmaps (*.bmp)|*.bmp'#11
+'FilterIndex'#2#0#4'left'#2'X'#3'top'#2'p'#0#0#0 +'FilterIndex'#2#0#4'left'#2'X'#3'top'#2'p'#0#0#0

View File

@ -59,7 +59,7 @@ implementation
uses uses
{Units of package "Images For Lazarus"} {Units of package "Images For Lazarus"}
LazPNM, LazJPG, LazTGA, LazPNG, LazXPM, LazBMP; LazJPG, LazTGA; //, LazPNM, LazPNG, LazXPM, LazBMP;
{ TImagesExampleForm } { TImagesExampleForm }
@ -189,19 +189,19 @@ end;
initialization initialization
// LazPNG.Register; // LazPNG.Register;
// LazXPM.Register; // LazXPM.Register;
LazBMP.Register; // LazBMP.Register;
LazPNM.Register; // LazPNM.Register;
LazTGA.Register; LazTGA.Register;
LazJPG.Register; // LazJPG.Register;
{$I mainform.lrs} {$I mainform.lrs}
finalization finalization
// LazPNG.UnRegister; // LazPNG.UnRegister;
// LazXPM.UnRegister; // LazXPM.UnRegister;
LazBMP.UnRegister; // LazBMP.UnRegister;
LazPNM.UnRegister; // LazPNM.UnRegister;
LazTGA.UnRegister; LazTGA.UnRegister;
LazJPG.UnRegister; // LazJPG.UnRegister;
end. end.