- cleanup
  - fix TPicture.ForceType. It now copies an old image to the newly created. (fixes #0011674)

git-svn-id: trunk@16375 -
This commit is contained in:
paul 2008-09-03 03:32:50 +00:00
parent c8f918e694
commit 50f81163db
2 changed files with 6 additions and 5 deletions

View File

@ -995,12 +995,10 @@ var
Header: TIconHeader;
StreamStart: Int64;
IconDir: array of TIconDirEntry;
n, i: Integer;
n: Integer;
ImageCount: Word;
Color: TColor;
IconImage: TIconImage;
IntfImage: TLazIntfImage;
PNGSig: array[0..7] of Byte;
PNGWriter: TFPWriterPNG;
BMPWriter: TFPWriterBMP;
BmpPtr: PByte;

View File

@ -374,12 +374,15 @@ begin
end;
procedure TPicture.ForceType(GraphicType: TGraphicClass);
var
NewGraphic: TGraphic;
begin
if not (FGraphic is GraphicType) then
begin
NewGraphic := GraphicType.Create;
NewGraphic.Assign(FGraphic);
FGraphic.Free;
FGraphic := nil;
FGraphic := GraphicType.Create;
FGraphic := NewGraphic;
FGraphic.OnChange := @Changed;
FGraphic.OnProgress := @Progress;
Changed(Self);