mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: DrawBitmapAlpha function
This commit is contained in:
parent
cc113bc625
commit
5d8b50ad82
1 changed files with 17 additions and 0 deletions
|
|
@ -238,6 +238,7 @@ type
|
|||
}
|
||||
function GetBitmap(iIndex : PtrInt) : TBitmap;
|
||||
function DrawBitmap(iIndex: PtrInt; Canvas : TCanvas; X, Y: Integer) : Boolean;
|
||||
function DrawBitmapAlpha(iIndex: PtrInt; Canvas : TCanvas; X, Y: Integer) : Boolean;
|
||||
{en
|
||||
Draws bitmap stretching it if needed to Width x Height.
|
||||
If Width is 0 then full bitmap width is used.
|
||||
|
|
@ -1544,6 +1545,22 @@ begin
|
|||
Result := DrawBitmap(iIndex, Canvas, X, Y, gIconsSize, gIconsSize); // No bitmap stretching.
|
||||
end;
|
||||
|
||||
function TPixMapManager.DrawBitmapAlpha(iIndex: PtrInt; Canvas: TCanvas; X, Y: Integer): Boolean;
|
||||
var
|
||||
ARect: TRect;
|
||||
ABitmap: Graphics.TBitmap;
|
||||
begin
|
||||
ABitmap:= GetBitmap(iIndex);
|
||||
Result := Assigned(ABitmap);
|
||||
if Result then
|
||||
begin
|
||||
BitmapAlpha(ABitmap, 0.5);
|
||||
ARect := Classes.Bounds(X, Y, gIconsSize, gIconsSize);
|
||||
Canvas.StretchDraw(aRect, ABitmap);
|
||||
ABitmap.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPixMapManager.DrawBitmap(iIndex: PtrInt; Canvas: TCanvas; X, Y, Width, Height: Integer): Boolean;
|
||||
|
||||
procedure TrySetSize(aWidth, aHeight: Integer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue