Created
May 18, 2017 06:08
-
-
Save lucmarcio/f3f87a5539e20dbe1f50ec1c124f3aca to your computer and use it in GitHub Desktop.
GetIcone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TForm1.getIcone(const icone: string): TBitmap; | |
var | |
RS: TResourceStream; | |
begin | |
Result := TBitmap.Create; | |
if (icone<> '') and (FindResource(hInstance, PChar(icone), RT_RCDATA) <> 0) then | |
begin | |
try | |
RS := TResourceStream.Create(hInstance, icone, RT_RCDATA); | |
try | |
Result.LoadfromStream(RS); | |
finally | |
RS.DisposeOf; | |
end; | |
finally | |
end; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment