/// <summary> /// Removes the frame at the specified index and frees all freeable resources associated with it. /// </summary> /// <param name="index">The zero-based index of the frame to remove.</param> /// <exception cref="InvalidOperationException">Cannot remove last frame.</exception> public void RemoveFrame(int index) { if (index == 0 && this.Count == 1) { throw new InvalidOperationException("Cannot remove last frame."); } ImageFrame <TPixel> frame = this.frames[index]; this.frames.RemoveAt(index); frame.Dispose(); }