Fixed: determine transparent color before resizing the component icon
This commit is contained in:
parent
804603986f
commit
6fdf574708
Binary file not shown.
@ -17,7 +17,7 @@ uses
|
|||||||
|
|
||||||
BaseSwDialog,
|
BaseSwDialog,
|
||||||
BaseSwObjects,
|
BaseSwObjects,
|
||||||
CmpSwFilters, UnSwDialog;
|
CmpSwFilters;
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -180,6 +180,7 @@ var
|
|||||||
packageHandle: THandle;
|
packageHandle: THandle;
|
||||||
bitmapHandle: THandle;
|
bitmapHandle: THandle;
|
||||||
bitmap: Graphics.TBitmap;
|
bitmap: Graphics.TBitmap;
|
||||||
|
transpColor: TColor;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := -1;
|
Result := -1;
|
||||||
@ -197,6 +198,7 @@ begin
|
|||||||
bitmap := Graphics.TBitmap.Create();
|
bitmap := Graphics.TBitmap.Create();
|
||||||
try
|
try
|
||||||
bitmap.Handle := bitmapHandle;
|
bitmap.Handle := bitmapHandle;
|
||||||
|
transpColor := bitmap.TransparentColor;
|
||||||
|
|
||||||
if (bitmap.Width <> FImageList.Width) or
|
if (bitmap.Width <> FImageList.Width) or
|
||||||
(bitmap.Height <> FImageList.Height) then
|
(bitmap.Height <> FImageList.Height) then
|
||||||
@ -204,7 +206,7 @@ begin
|
|||||||
ResizeBitmap(bitmap, FImageList.Width, FImageList.Height);
|
ResizeBitmap(bitmap, FImageList.Width, FImageList.Height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := FImageList.AddMasked(bitmap, bitmap.TransparentColor);
|
Result := FImageList.AddMasked(bitmap, transpColor);
|
||||||
finally
|
finally
|
||||||
FreeAndNil(bitmap);
|
FreeAndNil(bitmap);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user