有人可以告诉我如何从 HTML 视频标签中抓取照片吗?
我有一个带有视频标签的 aspx 页面。
<div id="container">
<video autoplay="true" runat="server" id="videoElement">
</video>
</div>
我想在单击按钮时截取屏幕截图。
如果我能得到任何线索,我将非常感激。
哇,非常酷的人访问了这个问题。投反对票,不发表任何评论。 我已经找到了如何抓取屏幕截图的解决方案。
第一个解决方案
//Create a new bitmap.
var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height,
PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap.
var gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner.
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X,
Screen.PrimaryScreen.Bounds.Y,
0,
0,
Screen.PrimaryScreen.Bounds.Size,
CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen.
bmpScreenshot.Save("Screenshot.png", ImageFormat.Png);
第二种解决方案:
这是一个参考样式链接
codepen.io/chrisbeast/pen/ebYwpX
访问此链接,适用于桌面和移动浏览器。