mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 22:38:32 +01:00
Graphics: Fix color transparency in 24bpp TRasterImage when Transparent is set before Handle is created. Issue #41726
This commit is contained in:
parent
33070a7760
commit
4fd3a8e598
@ -1246,6 +1246,7 @@ type
|
||||
FUpdateCanvasOnly: Boolean;
|
||||
FMasked: Boolean;
|
||||
FTransparentPending: Boolean;
|
||||
FTransparentDelayed: Boolean;
|
||||
|
||||
procedure CanvasChanging(Sender: TObject);
|
||||
procedure CreateCanvas;
|
||||
|
||||
@ -99,6 +99,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if SrcImage.FTransparentDelayed then
|
||||
begin
|
||||
SrcImage.ApplyTransparent;
|
||||
SrcImage.MaskHandleNeeded;
|
||||
SrcImage.FTransparentDelayed := false;
|
||||
end;
|
||||
|
||||
if SrcImage.MaskHandleAllocated
|
||||
then CopyMask(SrcImage.MaskHandle);
|
||||
|
||||
@ -234,6 +241,16 @@ begin
|
||||
BitmapHandleNeeded;
|
||||
if not BitmapHandleAllocated then Exit;
|
||||
|
||||
if FTransparentDelayed then
|
||||
begin
|
||||
ApplyTransparent;
|
||||
if FTransparentColor = clDefault then
|
||||
Mask(RequestTransparentColor)
|
||||
else
|
||||
Mask(FTransparentColor);
|
||||
FTransparentDelayed := false;
|
||||
end;
|
||||
|
||||
if Masked then
|
||||
UseMaskHandle:=MaskHandle
|
||||
else
|
||||
@ -717,6 +734,9 @@ begin
|
||||
lTransparent := GetTransparent();
|
||||
if AValue = lTransparent then Exit;
|
||||
|
||||
if not HandleAllocated then
|
||||
FTransparentDelayed := true;
|
||||
|
||||
FTransparentPending := AValue;
|
||||
ApplyTransparent;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user