public static IEnumerable <BitmapVideoFrameWrapper> WrapFrames(IEnumerable <PointerBitmap> frames) { MemoryBitmap tmp = default; foreach (var f in frames) { f.CopyTo(ref tmp); var bmp = tmp.ToGDIBitmap(); yield return(new BitmapVideoFrameWrapper(bmp)); } }