diff --git a/lcl/imglist.pp b/lcl/imglist.pp index 23372f1706..21adb49aec 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -53,7 +53,7 @@ uses // LCL LCLStrConsts, LCLIntf, LResources, LCLType, LCLProc, Graphics, GraphType, LCLClasses, IntfGraphics, - WSReferences; + WSReferences, RtlConsts; type TImageIndex = type integer; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index fb23b26f5c..d3f675414f 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -47,14 +47,10 @@ function GetDefaultGlyph(ResourceName: string; ScalePercent: Integer; begin if ScalePercent<>100 then ResourceName := ResourceName+'_'+IntToStr(ScalePercent); - Result := TPortableNetworkGraphic.Create; - if IgnoreMissingResource - and (FindResource(HInstance, PChar(ResourceName), Result.GetResourceType)=0) then - begin - FreeAndNil(Result); - Exit; - end else - Result.LoadFromResourceName(hInstance, ResourceName); + + Result := CreateBitmapFromResourceName(HINSTANCE, ResourceName); + if (Result=nil) and not IgnoreMissingResource then + raise EResNotFound.CreateFmt(SResNotFound,[ResourceName]); end; {------------------------------------------------------------------------------