You've already forked lazarus-ccr
* Use the native LCL methods to build bitmap mask in system check images
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1053 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -5193,31 +5193,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef Windows}
|
|
||||||
procedure ClearAlphaChannel(Bitmap: HBitmap; PixelCount: Integer);
|
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
DIB: TDIBSection;
|
|
||||||
P: PCardinal;
|
|
||||||
begin
|
|
||||||
P := nil;
|
|
||||||
if Bitmap <> 0 then
|
|
||||||
begin
|
|
||||||
if GetObject(Bitmap, SizeOf(DIB), @DIB) = SizeOf(DIB) then
|
|
||||||
begin
|
|
||||||
if DIB.dsBm.bmPlanes * DIB.dsBm.bmBitsPixel = 32 then
|
|
||||||
P := DIB.dsBm.bmBits;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if P = nil then
|
|
||||||
Exit;
|
|
||||||
for i:= 0 to PixelCount - 1 do
|
|
||||||
(P + i)^ := (P + i)^ and $00FFFFFF;
|
|
||||||
end;
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
|
|
||||||
function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer;
|
function CalculateScanline(Bits: Pointer; Width, Height, Row: Integer): Pointer;
|
||||||
|
|
||||||
// Helper function to calculate the start address for the given row.
|
// Helper function to calculate the start address for the given row.
|
||||||
@ -5424,10 +5399,8 @@ begin
|
|||||||
// Add the 20 system checkbox and radiobutton images.
|
// Add the 20 system checkbox and radiobutton images.
|
||||||
for I := 0 to 19 do
|
for I := 0 to 19 do
|
||||||
AddSystemImage(I);
|
AddSystemImage(I);
|
||||||
//todo: there's a bug in LCL that prevents mask creation of loaded bitmaps in windows
|
BM.TransparentColor := MaskColor;
|
||||||
//is necessary to remove the alpha opacity
|
BM.Transparent := True;
|
||||||
ClearAlphaChannel(BM.Handle, BM.Height*BM.Width);
|
|
||||||
BM.MaskHandle := CreateBitmapMask(BM.Canvas.Handle, BM.Width, BM.Height, MaskColor);
|
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user