diff --git a/lcl/graphics.pp b/lcl/graphics.pp index a6c00cd25a..6e17898f99 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -1726,6 +1726,8 @@ function CreateBitmapFromLazarusResource(const AName: String; AMinimumClass: TCu function CreateBitmapFromLazarusResource(AHandle: TLResource): TCustomBitmap; function CreateBitmapFromLazarusResource(AHandle: TLResource; AMinimumClass: TCustomBitmapClass): TCustomBitmap; +function CreateCompatibleBitmaps(const ARawImage: TRawImage; out ABitmap, AMask: HBitmap; ASkipMask: Boolean = False): Boolean; + var { Stores information about the current screen diff --git a/lcl/imglist.pp b/lcl/imglist.pp index 28138baebb..1e97e06be7 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -171,8 +171,8 @@ type procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; AEnabled: Boolean = True); overload; procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; ADrawEffect: TGraphicsDrawEffect); overload; procedure FillDescription(out ADesc: TRawImageDescription); - procedure GetBitmap(Index: Integer; Image: TBitmap); overload; - procedure GetBitmap(Index: Integer; Image: TBitmap; AEffect: TGraphicsDrawEffect); overload; + procedure GetBitmap(Index: Integer; Image: TCustomBitmap); overload; + procedure GetBitmap(Index: Integer; Image: TCustomBitmap; AEffect: TGraphicsDrawEffect); overload; procedure GetRawImage(Index: Integer; out Image: TRawImage); function GetHotSpot: TPoint; virtual; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 4ca9fbe011..9524a7e828 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -529,12 +529,12 @@ end; Creates a copy of the index'th image. ------------------------------------------------------------------------------} -procedure TCustomImageList.GetBitmap(Index: Integer; Image: TBitmap); +procedure TCustomImageList.GetBitmap(Index: Integer; Image: TCustomBitmap); begin GetBitmap(Index, Image, gdeNormal); end; -procedure TCustomImageList.GetBitmap(Index: Integer; Image: TBitmap; +procedure TCustomImageList.GetBitmap(Index: Integer; Image: TCustomBitmap; AEffect: TGraphicsDrawEffect); var RawImg: TRawImage; @@ -547,7 +547,7 @@ begin RawImg.PerformEffect(AEffect, True); - if not RawImage_CreateBitmaps(RawImg, ImgHandle, MskHandle, True) + if not CreateCompatibleBitmaps(RawImg, ImgHandle, MskHandle, True) then begin // bummer, the widgetset doesn't support our 32bit format, try device ListImg := TLazIntfImage.Create(RawImg, False);