public bool Finish()
{
if (!_started) return false;
bool ok = true;
_started = false;
try {
_fs.WriteByte(0x3b); // gif trailer
_fs.Flush();
if (_closeStream)
_fs.Close();
} catch (IOException) {
ok = false;
}
// reset for subsequent use
_transIndex = 0;
_fs = null;
_image = null;
_pixels = null;
_indexedPixels = null;
_colorTab = null;
_closeStream = false;
_firstFrame = true;
return ok;
}