Thursday, November 30, 2017

DELPHI - How read image from .dll into TImageList

var
  FDLL : HMODULE;
  ImageMenu: TImageList;
begin
  { DLL preparation }
  FDLL := LoadLibrary( PChar( ExtractFilePath( Application.ExeName ) + gcsDllFile ) );
  if FDLL = 0 then
    begin
      doError( ERROR_FILE_NOT_EXIST, [ 'DLL file not found:', 'a9dll.dll' ] );
      Application.Terminate;
    end;
  ..
  { read images into ImageMenu }
  ImageMenu.Clear;
  ImageMenu.ResInstLoad( FDLL, rtBitmap, 'A_NEW16', clAqua );            {0}
  ImageMenu.ResInstLoad( FDLL, rtBitmap, 'A_OPEN16', clAqua );           {1}
  ImageMenu.ResInstLoad( FDLL, rtBitmap, 'A_SAVE16', clAqua );           {2} 
  ..
end;

No comments:

Post a Comment