ImageEn, unit iexBitmaps

TIOParams.IsResource

TIOParams.IsResource


Declaration

property IsResource: Boolean;


Description

Some formats (BMP, ICO, CUR) do not contain all headers when stored as resources (e.g. in EXE, DLL, etc...). If you set IsResource = true, ImageEn will skip loading of these headers so the image can be loaded correctly.

Default: False


Demo

Demo  Demos\InputOutput\ResourceLoader\ResourceLoader.dpr


Example

// Load resource 143 in "Bitmap" from "explorer.exe" (should be a little Windows logo)
var
  re: TIEResourceExtractor;
  buffer: Pointer;
  bufferLen: Integer;
begin
  re := TIEResourceExtractor.Create('explorer.exe');
  try
    buffer := re.GetBuffer('Bitmap', 'INTRESOURCE:143', bufferLen);
    ImageEnView1.IO.Params.IsResource := true;
    ImageEnView1.IO.LoadFromBuffer(buffer, bufferLen, ioBMP);
  finally
    re.Free;
  end;
end;