mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 00:40:18 +02:00
LCL: imglist: improve GetDefaultGlyph - support various image formats
git-svn-id: trunk@57861 -
This commit is contained in:
parent
59e52062f8
commit
b62e11282f
@ -53,7 +53,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
LCLStrConsts, LCLIntf, LResources, LCLType, LCLProc, Graphics, GraphType,
|
LCLStrConsts, LCLIntf, LResources, LCLType, LCLProc, Graphics, GraphType,
|
||||||
LCLClasses, IntfGraphics,
|
LCLClasses, IntfGraphics,
|
||||||
WSReferences;
|
WSReferences, RtlConsts;
|
||||||
|
|
||||||
type
|
type
|
||||||
TImageIndex = type integer;
|
TImageIndex = type integer;
|
||||||
|
@ -47,14 +47,10 @@ function GetDefaultGlyph(ResourceName: string; ScalePercent: Integer;
|
|||||||
begin
|
begin
|
||||||
if ScalePercent<>100 then
|
if ScalePercent<>100 then
|
||||||
ResourceName := ResourceName+'_'+IntToStr(ScalePercent);
|
ResourceName := ResourceName+'_'+IntToStr(ScalePercent);
|
||||||
Result := TPortableNetworkGraphic.Create;
|
|
||||||
if IgnoreMissingResource
|
Result := CreateBitmapFromResourceName(HINSTANCE, ResourceName);
|
||||||
and (FindResource(HInstance, PChar(ResourceName), Result.GetResourceType)=0) then
|
if (Result=nil) and not IgnoreMissingResource then
|
||||||
begin
|
raise EResNotFound.CreateFmt(SResNotFound,[ResourceName]);
|
||||||
FreeAndNil(Result);
|
|
||||||
Exit;
|
|
||||||
end else
|
|
||||||
Result.LoadFromResourceName(hInstance, ResourceName);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user