> -----Original Message-----
> From: Alistair George [SMTP:[EMAIL PROTECTED]]
[...]
> Seems to me it would have made more sense to design the Bitmap with a
> self-check for iscreated, and if true then run a constructor with any
> construction parameters different.
> Indeed, there are several responsibilities with Bitmaps that may be could
> be
> done within the component itself, rather than 'the responsibility of the
> programmer' (gets out hose to cool off):-)
> Al+
>
Ah, but a TBitmap is just a pointer; there is no way it can know
whether it points to a valid bitmap.
There is never any reason to recreate an object, unless it has been
destroyed in between times.
If you must recreate the bitmap, be sure and match every Create with
a Free:
bitmap := TBitmap.Create;
try
{...}
finally
bitmap.Free;
end;
try
bitmap := TBitmap.Create;
{...}
finally
bitmap.Free;
end;
Regards, Paul.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz