void addframe(object bmp) { lock (avienclock) { newStream.AddFrame((Bitmap) bmp); ((Bitmap) bmp).Dispose(); } }