diff --git a/lcl/imglist.pp b/lcl/imglist.pp index d54d6ec494..787f5148ec 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -147,6 +147,7 @@ type function WSCreateReference(AParams: TCreateParams): PWSReference; override; class procedure WSRegisterClass; override; procedure ReferenceDestroying; override; + procedure UpdateReference; public destructor Destroy; override; public diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index f2b7cdcfec..f12a5fab62 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -719,6 +719,7 @@ var Add(bmp, nil); bmp.Free; end; + UpdateReference; end; procedure DoReadLaz2; @@ -757,6 +758,7 @@ var Add(bmp, nil); bmp.Free; end; + UpdateReference; end; procedure DoReadLaz3Header(BStream: TStream); @@ -776,7 +778,10 @@ var begin DoReadLaz3Header(AStream); if FCount > 0 then + begin DoReadLaz3Data(AStream); + UpdateReference; + end; end; procedure DoReadLaz4; @@ -796,6 +801,7 @@ var I.Position := 0; D := TDecompressionStream.Create(I); DoReadLaz3Data(D); + UpdateReference; finally I.Free; D.Free; @@ -862,6 +868,7 @@ var end; CreateImagesFromRawImage(IntfImage,NewCount); + UpdateReference; finally // clean up ImgReader.Free; @@ -975,6 +982,15 @@ begin FImageList.DoDestroyResolutionReference(FWidth, Reference._Handle); end; +procedure TCustomImageListResolution.UpdateReference; +begin + if HandleAllocated then + begin + DestroyReference; + ReferenceNeeded; + end; +end; + procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas; Index: Integer; ARect: TRect; Enabled: Boolean); var