* now units are manually registered by user

git-svn-id: trunk@5888 -
This commit is contained in:
mazen 2004-08-29 17:24:24 +00:00
parent a303ae29e9
commit 90c2b1d394
12 changed files with 202 additions and 78 deletions

View File

@ -5,75 +5,63 @@
<General> <General>
<ProjectType Value="Application"/> <ProjectType Value="Application"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<ActiveEditorIndexAtStart Value="3"/> <ActiveEditorIndexAtStart Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="Images Example"/> <Title Value="Images Example"/>
</General> </General>
<JumpHistory Count="10" HistoryIndex="9"> <JumpHistory Count="7" HistoryIndex="6">
<Position1> <Position1>
<Filename Value="mainform.pas"/> <Filename Value="mainform.pas"/>
<Caret Line="6" Column="81" TopLine="1"/> <Caret Line="63" Column="35" TopLine="47"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/components/images/laztga.pas"/> <Filename Value="mainform.pas"/>
<Caret Line="59" Column="22" TopLine="54"/> <Caret Line="62" Column="3" TopLine="16"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/> <Filename Value="mainform.pas"/>
<Caret Line="247" Column="1" TopLine="990"/> <Caret Line="47" Column="35" TopLine="34"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/> <Filename Value="mainform.pas"/>
<Caret Line="910" Column="24" TopLine="897"/> <Caret Line="96" Column="1" TopLine="86"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/> <Filename Value="mainform.pas"/>
<Caret Line="86" Column="31" TopLine="60"/> <Caret Line="151" Column="1" TopLine="139"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/> <Filename Value="mainform.pas"/>
<Caret Line="154" Column="1" TopLine="140"/> <Caret Line="61" Column="19" TopLine="51"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/> <Filename Value="mainform.pas"/>
<Caret Line="909" Column="5" TopLine="897"/> <Caret Line="1" Column="1" TopLine="1"/>
</Position7> </Position7>
<Position8>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/intfgraphics.pas"/>
<Caret Line="1482" Column="1" TopLine="1469"/>
</Position8>
<Position9>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Caret Line="153" Column="1" TopLine="140"/>
</Position9>
<Position10>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Caret Line="847" Column="18" TopLine="833"/>
</Position10>
</JumpHistory> </JumpHistory>
<Units Count="29"> <Units Count="40">
<Unit0> <Unit0>
<CursorPos X="39" Y="10"/> <CursorPos X="39" Y="10"/>
<EditorIndex Value="7"/> <EditorIndex Value="1"/>
<Filename Value="imagesexample.lpr"/> <Filename Value="imagesexample.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UnitName Value="JPEGExample"/> <UnitName Value="JPEGExample"/>
<UsageCount Value="38"/> <UsageCount Value="40"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<CursorPos X="65" Y="61"/> <CursorPos X="12" Y="204"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<Filename Value="mainform.pas"/> <Filename Value="mainform.pas"/>
<ComponentName Value="ImagesExampleForm"/> <ComponentName Value="ImagesExampleForm"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<ResourceFilename Value="mainform.lrs"/> <ResourceFilename Value="mainform.lrs"/>
<TopLine Value="56"/> <TopLine Value="179"/>
<UnitName Value="MainForm"/> <UnitName Value="MainForm"/>
<UsageCount Value="38"/> <UsageCount Value="40"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<CursorPos X="20" Y="156"/> <CursorPos X="20" Y="156"/>
@ -211,13 +199,11 @@
</Unit21> </Unit21>
<Unit22> <Unit22>
<CursorPos X="2" Y="4"/> <CursorPos X="2" Y="4"/>
<EditorIndex Value="6"/>
<Filename Value="README.txt"/> <Filename Value="README.txt"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<SyntaxHighlighter Value="None"/> <SyntaxHighlighter Value="None"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="26"/> <UsageCount Value="28"/>
</Unit22> </Unit22>
<Unit23> <Unit23>
<CursorPos X="1" Y="468"/> <CursorPos X="1" Y="468"/>
@ -227,47 +213,112 @@
</Unit23> </Unit23>
<Unit24> <Unit24>
<CursorPos X="31" Y="846"/> <CursorPos X="31" Y="846"/>
<EditorIndex Value="3"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/> <Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/include/bitmap.inc"/>
<Loaded Value="True"/>
<TopLine Value="833"/> <TopLine Value="833"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
</Unit24> </Unit24>
<Unit25> <Unit25>
<CursorPos X="20" Y="52"/> <CursorPos X="20" Y="52"/>
<EditorIndex Value="1"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/components/images/laztga.pas"/> <Filename Value="/home/neifer/FPC/Demo/src/lazarus/components/images/laztga.pas"/>
<Loaded Value="True"/>
<TopLine Value="54"/> <TopLine Value="54"/>
<UnitName Value="LazTGA"/> <UnitName Value="LazTGA"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
</Unit25> </Unit25>
<Unit26> <Unit26>
<CursorPos X="1" Y="153"/> <CursorPos X="1" Y="153"/>
<EditorIndex Value="2"/>
<Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/> <Filename Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Loaded Value="True"/>
<TopLine Value="140"/> <TopLine Value="140"/>
<UnitName Value="FPReadTGA"/> <UnitName Value="FPReadTGA"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
</Unit26> </Unit26>
<Unit27> <Unit27>
<CursorPos X="1" Y="1482"/> <CursorPos X="1" Y="1482"/>
<EditorIndex Value="4"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/intfgraphics.pas"/> <Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/intfgraphics.pas"/>
<Loaded Value="True"/>
<TopLine Value="1469"/> <TopLine Value="1469"/>
<UnitName Value="IntfGraphics"/> <UnitName Value="IntfGraphics"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
</Unit27> </Unit27>
<Unit28> <Unit28>
<CursorPos X="1" Y="1469"/> <CursorPos X="1" Y="1469"/>
<EditorIndex Value="5"/>
<Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/interfaces/gtk/gtkobject.inc"/> <Filename Value="/home/neifer/FPC/Demo/src/lazarus/lcl/interfaces/gtk/gtkobject.inc"/>
<Loaded Value="True"/>
<TopLine Value="1455"/> <TopLine Value="1455"/>
<UsageCount Value="12"/> <UsageCount Value="12"/>
</Unit28> </Unit28>
<Unit29>
<CursorPos X="16" Y="22"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/images/imagesforlazarus.pas"/>
<TopLine Value="1"/>
<UnitName Value="ImagesForLazarus"/>
<UsageCount Value="10"/>
</Unit29>
<Unit30>
<CursorPos X="68" Y="69"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/packager/registration/lazaruspackageintf.pas"/>
<TopLine Value="53"/>
<UnitName Value="LazarusPackageIntf"/>
<UsageCount Value="10"/>
</Unit30>
<Unit31>
<CursorPos X="39" Y="699"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/packager/packagesystem.pas"/>
<TopLine Value="697"/>
<UnitName Value="PackageSystem"/>
<UsageCount Value="10"/>
</Unit31>
<Unit32>
<CursorPos X="14" Y="70"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/images/lazpnm.pas"/>
<TopLine Value="61"/>
<UnitName Value="LazPNM"/>
<UsageCount Value="10"/>
</Unit32>
<Unit33>
<CursorPos X="23" Y="463"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/lcl/include/picture.inc"/>
<TopLine Value="453"/>
<UsageCount Value="10"/>
</Unit33>
<Unit34>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/lazhtmllite.lpk"/>
<SyntaxHighlighter Value="None"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit34>
<Unit35>
<CursorPos X="51" Y="23"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/lazhtmllite.pas"/>
<TopLine Value="1"/>
<UnitName Value="LazHTMLLite"/>
<UsageCount Value="10"/>
</Unit35>
<Unit36>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/htmllite.pas"/>
<TopLine Value="2945"/>
<UnitName Value="HTMLLite"/>
<UsageCount Value="10"/>
</Unit36>
<Unit37>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/htmllite/htmllite.dcr"/>
<SyntaxHighlighter Value="None"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit37>
<Unit38>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/memds/memdslaz.pas"/>
<TopLine Value="1"/>
<UnitName Value="MemDSLaz"/>
<UsageCount Value="10"/>
</Unit38>
<Unit39>
<CursorPos X="1" Y="1"/>
<Filename Value="/home/mazen/FPC/Demo/src/lazarus/components/memds/memdsicons.lrs"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit39>
</Units> </Units>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -300,12 +351,17 @@
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>
</CodeGeneration> </CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
</Debugging>
</Linking>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>
</CompilerOptions> </CompilerOptions>
<Debugging> <Debugging>
<BreakPoints Count="3"> <BreakPoints Count="5">
<Item1> <Item1>
<Source Value="/home/satan/pascal/lazarus/lcl/interfaces/gtk2/gtk2int.pas"/> <Source Value="/home/satan/pascal/lazarus/lcl/interfaces/gtk2/gtk2int.pas"/>
<Line Value="34"/> <Line Value="34"/>
@ -318,6 +374,14 @@
<Source Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/> <Source Value="/home/neifer/FPC/Demo/src/fpc/fcl/image/fpreadtga.pp"/>
<Line Value="153"/> <Line Value="153"/>
</Item3> </Item3>
<Item4>
<Source Value="/home/mazen/FPC/Demo/src/lazarus/packager/packagesystem.pas"/>
<Line Value="702"/>
</Item4>
<Item5>
<Source Value="/home/mazen/FPC/Demo/src/lazarus/packager/registration/lazaruspackageintf.pas"/>
<Line Value="69"/>
</Item5>
</BreakPoints> </BreakPoints>
</Debugging> </Debugging>
</CONFIG> </CONFIG>

View File

@ -2,12 +2,12 @@ object ImagesExampleForm: TImagesExampleForm
Caption = 'Example for package "Images For Lazarus"' Caption = 'Example for package "Images For Lazarus"'
ClientHeight = 416 ClientHeight = 416
ClientWidth = 425 ClientWidth = 425
PixelsPerInch = 101 PixelsPerInch = 95
HorzScrollBar.Page = 426 HorzScrollBar.Page = 426
VertScrollBar.Page = 417 VertScrollBar.Page = 417
Left = 544 Left = 516
Height = 416 Height = 416
Top = 187 Top = 160
Width = 425 Width = 425
object ImageGroupBox: TGroupBox object ImageGroupBox: TGroupBox
Align = alTop Align = alTop

View File

@ -3,8 +3,8 @@
LazarusResources.Add('TImagesExampleForm','FORMDATA',[ LazarusResources.Add('TImagesExampleForm','FORMDATA',[
'TPF0'#18'TImagesExampleForm'#17'ImagesExampleForm'#7'Caption'#6'(Example for' 'TPF0'#18'TImagesExampleForm'#17'ImagesExampleForm'#7'Caption'#6'(Example for'
+' package "Images For Lazarus"'#12'ClientHeight'#3#160#1#11'ClientWidth'#3 +' package "Images For Lazarus"'#12'ClientHeight'#3#160#1#11'ClientWidth'#3
+#169#1#13'PixelsPerInch'#2'e'#18'HorzScrollBar.Page'#3#170#1#18'VertScrollBa' +#169#1#13'PixelsPerInch'#2'_'#18'HorzScrollBar.Page'#3#170#1#18'VertScrollBa'
+'r.Page'#3#161#1#4'Left'#3' '#2#6'Height'#3#160#1#3'Top'#3#187#0#5'Width'#3 +'r.Page'#3#161#1#4'Left'#3#4#2#6'Height'#3#160#1#3'Top'#3#160#0#5'Width'#3
+#169#1#0#9'TGroupBox'#13'ImageGroupBox'#5'Align'#7#5'alTop'#7'Anchors'#11#5 +#169#1#0#9'TGroupBox'#13'ImageGroupBox'#5'Align'#7#5'alTop'#7'Anchors'#11#5
+'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#3'...'#12'ClientHeight'#3';'#1 +'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#3'...'#12'ClientHeight'#3';'#1
+#11'ClientWidth'#3#165#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#0 +#11'ClientWidth'#3#165#1#11'ParentColor'#9#11'ParentCtl3D'#8#8'TabOrder'#2#0

View File

@ -58,10 +58,8 @@ var
implementation implementation
uses uses
{Load for all package units : LazPNG, LazPNM, LazJPG, LazBMP, LazTGA, LazXPM} {Units of package "Images For Lazarus"}
ImagesForLazarus, LazPNM, LazJPG, LazTGA, LazPNG, LazXPM, LazBMP;
{Need LazJPG to use TJPGImage class}
LazJPG;
{ TImagesExampleForm } { TImagesExampleForm }
@ -93,8 +91,6 @@ begin
end; end;
procedure TImagesExampleForm.LoadImageButtonClick(Sender: TObject); procedure TImagesExampleForm.LoadImageButtonClick(Sender: TObject);
var
JPEG: TJPGImage;
begin begin
OpenPictureDialog1.Options:=OpenPictureDialog1.Options+[ofFileMustExist]; OpenPictureDialog1.Options:=OpenPictureDialog1.Options+[ofFileMustExist];
if not OpenPictureDialog1.Execute then exit; if not OpenPictureDialog1.Execute then exit;
@ -150,8 +146,6 @@ begin
end; end;
procedure TImagesExampleForm.SaveImageButtonClick(Sender: TObject); procedure TImagesExampleForm.SaveImageButtonClick(Sender: TObject);
var
JPEG: TJPGImage;
begin begin
if Image1.Picture.Graphic=nil then begin if Image1.Picture.Graphic=nil then begin
MessageDlg('No image','Please open an image, before save',mtError, MessageDlg('No image','Please open an image, before save',mtError,
@ -193,7 +187,21 @@ begin
end; end;
initialization initialization
// LazPNG.Register;
// LazXPM.Register;
LazBMP.Register;
LazPNM.Register;
LazTGA.Register;
LazJPG.Register;
{$I mainform.lrs} {$I mainform.lrs}
finalization
// LazPNG.UnRegister;
// LazXPM.UnRegister;
LazBMP.UnRegister;
LazPNM.UnRegister;
LazTGA.UnRegister;
LazJPG.UnRegister;
end. end.

View File

@ -9,8 +9,14 @@
<UnitOutputDirectory Value="lib/"/> <UnitOutputDirectory Value="lib/"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<UnitStyle Value="0"/>
<Generate Value="Faster"/> <Generate Value="Faster"/>
</CodeGeneration> </CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="True"/>
</Debugging>
</Linking>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>
@ -23,7 +29,7 @@
<Files Count="7"> <Files Count="7">
<Item1> <Item1>
<Filename Value="lazpng.pas"/> <Filename Value="lazpng.pas"/>
<UnitName Value="Lazpng"/> <UnitName Value="LazPNG"/>
</Item1> </Item1>
<Item2> <Item2>
<Filename Value="readme.txt"/> <Filename Value="readme.txt"/>
@ -31,11 +37,13 @@
</Item2> </Item2>
<Item3> <Item3>
<Filename Value="lazpnm.pas"/> <Filename Value="lazpnm.pas"/>
<UnitName Value="Lazpnm"/> <HasRegisterProc Value="True"/>
<UnitName Value="LazPNM"/>
</Item3> </Item3>
<Item4> <Item4>
<Filename Value="lazjpg.pas"/> <Filename Value="lazjpg.pas"/>
<UnitName Value="Lazjpg"/> <HasRegisterProc Value="True"/>
<UnitName Value="LazJPG"/>
</Item4> </Item4>
<Item5> <Item5>
<Filename Value="lazbmp.pas"/> <Filename Value="lazbmp.pas"/>
@ -43,6 +51,7 @@
</Item5> </Item5>
<Item6> <Item6>
<Filename Value="laztga.pas"/> <Filename Value="laztga.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="LazTGA"/> <UnitName Value="LazTGA"/>
</Item6> </Item6>
<Item7> <Item7>

View File

@ -14,6 +14,9 @@ implementation
procedure Register; procedure Register;
begin begin
RegisterUnit('LazPNM', @LazPNM.Register);
RegisterUnit('LazJPG', @LazJPG.Register);
RegisterUnit('LazTGA', @LazTGA.Register);
end; end;
initialization initialization

View File

@ -42,6 +42,9 @@ type
const const
DefaultBMPMimeType = 'image/bmp'; DefaultBMPMimeType = 'image/bmp';
procedure Register;
procedure UnRegister;
implementation implementation
{ TBMPImage } { TBMPImage }
@ -95,13 +98,16 @@ begin
Result:='bmp'; Result:='bmp';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('bmp', 'BMP Image File', TBMPImage); TPicture.RegisterFileFormat('bmp', 'BMP Image File', TBMPImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultBMPMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultBMPMimeType),
TBMPImage); TBMPImage);
end;
finalization procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TBMPImage); TPicture.UnregisterGraphicClass(TBMPImage);
end;
end. end.

View File

@ -52,6 +52,9 @@ type
const const
DefaultJPGMimeType = 'image/jpeg'; DefaultJPGMimeType = 'image/jpeg';
procedure Register;
procedure UnRegister;
implementation implementation
{ TJPGImage } { TJPGImage }
@ -114,14 +117,18 @@ begin
Result:='jpg;jpeg'; Result:='jpg;jpeg';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('jpg', 'JPEG Image File', TJPGImage); TPicture.RegisterFileFormat('jpg', 'JPEG Image File', TJPGImage);
TPicture.RegisterFileFormat('jpeg', 'JPEG Image File', TJPGImage); TPicture.RegisterFileFormat('jpeg', 'JPEG Image File', TJPGImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultJPGMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultJPGMimeType),
TJPGImage); TJPGImage);
end;
finalization procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TJPGImage); TPicture.UnregisterGraphicClass(TJPGImage);
end;
end. end.

View File

@ -38,6 +38,9 @@ type
const const
DefaultPNGMimeType = 'image/png'; DefaultPNGMimeType = 'image/png';
procedure Register;
procedure UnRegister;
implementation implementation
{ TPNGImage } { TPNGImage }
@ -62,12 +65,16 @@ begin
Result:='png'; Result:='png';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('png', 'PNG Image File', TPNGImage); TPicture.RegisterFileFormat('png', 'PNG Image File', TPNGImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPNGMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPNGMimeType),
TPNGImage); TPNGImage);
finalization end;
procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TPNGImage); TPicture.UnregisterGraphicClass(TPNGImage);
end;
end. end.

View File

@ -40,6 +40,9 @@ const
DefaultPGMMimeType = 'image/pgm'; DefaultPGMMimeType = 'image/pgm';
DefaultPBMMimeType = 'image/pbm'; DefaultPBMMimeType = 'image/pbm';
procedure Register;
procedure UnRegister;
implementation implementation
{ TPNMImage } { TPNMImage }
@ -64,7 +67,8 @@ begin
Result:='ppm;pgm;pbm'; Result:='ppm;pgm;pbm';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('ppm', 'PNM Image File', TPNMImage); TPicture.RegisterFileFormat('ppm', 'PNM Image File', TPNMImage);
TPicture.RegisterFileFormat('pgm', 'PNM Image File', TPNMImage); TPicture.RegisterFileFormat('pgm', 'PNM Image File', TPNMImage);
TPicture.RegisterFileFormat('pbm', 'PNM Image File', TPNMImage); TPicture.RegisterFileFormat('pbm', 'PNM Image File', TPNMImage);
@ -74,9 +78,12 @@ initialization
TPNMImage); TPNMImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPBMMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultPBMMimeType),
TPNMImage); TPNMImage);
end;
finalization procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TPNMImage); TPicture.UnregisterGraphicClass(TPNMImage);
end;
end. end.

View File

@ -41,6 +41,9 @@ type
const const
DefaultTGAMimeType = 'image/tga'; DefaultTGAMimeType = 'image/tga';
procedure Register;
procedure UnRegister;
implementation implementation
{ TTGAImage } { TTGAImage }
@ -95,13 +98,17 @@ begin
Result:='tga'; Result:='tga';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('tga', 'TGA Image File', TTGAImage); TPicture.RegisterFileFormat('tga', 'TGA Image File', TTGAImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultTGAMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultTGAMimeType),
TTGAImage); TTGAImage);
end;
finalization procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TTGAImage); TPicture.UnregisterGraphicClass(TTGAImage);
end;
end. end.

View File

@ -41,6 +41,9 @@ type
const const
DefaultXPMMimeType = 'image/xpm'; DefaultXPMMimeType = 'image/xpm';
procedure Register;
procedure UnRegister;
implementation implementation
{ TXPMImage } { TXPMImage }
@ -95,13 +98,16 @@ begin
Result:='xpm'; Result:='xpm';
end; end;
initialization procedure Register;
begin
TPicture.RegisterFileFormat('xpm', 'XPM Image File', TXPMImage); TPicture.RegisterFileFormat('xpm', 'XPM Image File', TXPMImage);
TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultXPMMimeType), TPicture.RegisterClipboardFormat(RegisterClipboardFormat(DefaultXPMMimeType),
TXPMImage); TXPMImage);
end;
finalization procedure UnRegister;
begin
TPicture.UnregisterGraphicClass(TXPMImage); TPicture.UnregisterGraphicClass(TXPMImage);
end;
end. end.