Monday, October 4, 2010

Using big files

In the BB.Utils.BigFile namespace, there is a class called TBigFile that helps you handling compressed files merged into one file, this is an example of use:


  f: TBigFile;
  wave, bmp: TStream;



  f := TBigFile.Create;
  f.Load('test.big');
  bmp := f.GetFile('test.bmp');
  wave := f.GetFile('pow.wav');

  spr := TSprite.Create;
  spr.LoadFile(bmp, TRGB.Blue.ToInt(32));

Almost all classes that have a load filename method have an overloaded method can be be called with a stream. Creating a big file is piece of cake, an example can be found in demos\utils\BigFile.dpr

No comments:

Post a Comment