From 4ef7cfd8d19d567e88b95edb5873e742c8dfe2f6 Mon Sep 17 00:00:00 2001 From: tomb0 Date: Sat, 21 Jun 2008 12:46:05 +0000 Subject: [PATCH] - fixed after Lazarus bitmap rewrite git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@486 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rgbgraphics/example/rgbexample.lpi | 212 +++++++++++++++++- components/rgbgraphics/example/rgbunit.pas | 2 +- components/rgbgraphics/rgbgraphics.pas | 18 +- 3 files changed, 207 insertions(+), 25 deletions(-) diff --git a/components/rgbgraphics/example/rgbexample.lpi b/components/rgbgraphics/example/rgbexample.lpi index 34b3a3b4d..68c467d98 100644 --- a/components/rgbgraphics/example/rgbexample.lpi +++ b/components/rgbgraphics/example/rgbexample.lpi @@ -33,14 +33,16 @@ - + - + + + @@ -48,18 +50,20 @@ - - + + - + - - + + + + @@ -142,8 +146,8 @@ - - + + @@ -310,18 +314,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/rgbgraphics/example/rgbunit.pas b/components/rgbgraphics/example/rgbunit.pas index 7b6b0e787..89399d6e1 100644 --- a/components/rgbgraphics/example/rgbunit.pas +++ b/components/rgbgraphics/example/rgbunit.pas @@ -30,7 +30,7 @@ interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons, - RGBGraphics, ExtDlgs, ExtCtrls; + RGBGraphics, ExtDlgs; type diff --git a/components/rgbgraphics/rgbgraphics.pas b/components/rgbgraphics/rgbgraphics.pas index 52351ff2e..c0bcaf133 100644 --- a/components/rgbgraphics/rgbgraphics.pas +++ b/components/rgbgraphics/rgbgraphics.pas @@ -32,7 +32,7 @@ unit RGBGraphics; interface uses - Classes, SysUtils, LCLIntf, + Classes, SysUtils, LCLIntf, FPWriteBMP, LCLType, LCLProc, FPImage, LResources, IntfGraphics, GraphType, Graphics, Forms, Math, Clipbrd, RGBTypes, RGBRoutines, RGBUtils; @@ -283,15 +283,12 @@ end; constructor TRGB32Bitmap.CreateFromFile(const FileName: String); var Image: TLazIntfImage; - Reader: TFPCustomImageReader; begin Image := CreateDefaultLazIntfImage; - Reader := GetFPImageReaderForFileExtension(ExtractFileExt(FileName)).Create; try - Image.LoadFromFile(FileName, Reader); + Image.LoadFromFile(FileName); CreateFromLazIntfImage(Image); finally - Reader.Free; Image.Free; end; end; @@ -341,7 +338,7 @@ end; procedure TRGB32Bitmap.SaveToStream(Stream: TStream); begin - SaveToStream(Stream, Bounds(0, 0, Width, Height), TPixmap.GetDefaultFPWriter); + SaveToStream(Stream, Bounds(0, 0, Width, Height), TLazWriterXPM); end; procedure TRGB32Bitmap.SaveToStream(Stream: TStream; @@ -370,15 +367,12 @@ end; procedure TRGB32Bitmap.SaveToFile(const FileName: String); var Image: TLazIntfImage; - Writer: TFPCustomImageWriter; begin Image := CreateDefaultLazIntfImage; - Writer := GetFPImageWriterForFileExtension(ExtractFileExt(FileName)).Create; try inherited SaveToLazIntfImage(Image); - Image.SaveToFile(FileName, Writer); + Image.SaveToFile(FileName); finally - Writer.Free; Image.Free; end; end; @@ -460,8 +454,8 @@ begin PixmapStream := TMemoryStream.Create; BitmapStream := TMemoryStream.Create; Image := CreateDefaultLazIntfImage; - PixmapWriter := TPixmap.GetDefaultFPWriter.Create; - BitmapWriter := TBitmap.GetDefaultFPWriter.Create; + PixmapWriter := TLazWriterXPM.Create; + BitmapWriter := TFPWriterBMP.Create; try R := Mask.GetMaskedRect; SaveToLazIntfImage(Image, R);