mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:19:37 +02:00
lcl:
- 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:
parent
c8f918e694
commit
50f81163db
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user