mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 01:19:29 +02:00
parent
215cce41c2
commit
889ccccb90
@ -814,27 +814,18 @@ end;
|
|||||||
procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas;
|
procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas;
|
||||||
Index: Integer; ARect: TRect; Enabled: Boolean);
|
Index: Integer; ARect: TRect; Enabled: Boolean);
|
||||||
var
|
var
|
||||||
FI: TFPCompactImgRGBA8Bit;
|
Bmp: TBitmap;
|
||||||
Px: PRGBAQuad;
|
|
||||||
X, Y: Integer;
|
|
||||||
begin
|
begin
|
||||||
if ((ARect.Right-ARect.Left)=FWidth) and ((ARect.Bottom-ARect.Top)=FHeight) then
|
if ((ARect.Right-ARect.Left)=FWidth) and ((ARect.Bottom-ARect.Top)=FHeight) then
|
||||||
Draw(Canvas, ARect.Left, ARect.Top, Index, Enabled)
|
Draw(Canvas, ARect.Left, ARect.Top, Index, Enabled)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
FI := TFPCompactImgRGBA8Bit.Create(FWidth, FHeight);
|
Bmp := TBitmap.Create;
|
||||||
try
|
try
|
||||||
Px := @FData[Index * FWidth * FHeight];
|
GetBitmap(Index, Bmp, EffectMap[Enabled]);
|
||||||
for Y := 0 to FHeight-1 do
|
Canvas.StretchDraw(ARect, Bmp);
|
||||||
for X := 0 to FWidth-1 do
|
|
||||||
begin
|
|
||||||
FI.Colors[X, Y] := FPColor(Px^.Red, Px^.Green, Px^.Blue, Px^.Alpha);
|
|
||||||
Inc(Px);
|
|
||||||
end;
|
|
||||||
|
|
||||||
TFPCustomCanvas(Canvas).StretchDraw(ARect.Left, ARect.Top, ARect.Right-ARect.Left, ARect.Bottom-ARect.Top, FI);
|
|
||||||
finally
|
finally
|
||||||
FI.Free;
|
Bmp.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user