1
0
mirror of synced 2024-11-15 00:43:50 +00:00

Fixed: determine transparent color before resizing the component icon

This commit is contained in:
Mark van Renswoude 2007-12-19 14:11:31 +00:00
parent 804603986f
commit 6fdf574708
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -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;