Try this Alistair

function MakeMeABitmap:TBitmap;
begin
  result := TBitmap.Create;
end;

procedure Main;
var
  A :Tbitmap;
begin
  A := MakeMeABitmap;
  {
  Do whatever you like to A
  }
  A.Free; // this is the bitmap cleanup.

  // Or tidier and safer
  with MakeMeABitmap do try
    {
    Do whatever you like to your new bitmap
    }
  finally
    Free; // This frees the bitmap
  end;
end;

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to