在wpf / Windows中将桌面屏幕捕获为视频 [英] capture desktop screen as video in wpf/Windows

查看:295
本文介绍了在wpf / Windows中将桌面屏幕捕获为视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用wpf捕获/记录桌面活动作为视频获取解决方案http://www.c-sharpcorner.com/UploadFile/armoghanasif/CaptureDesktopActivities11122005013755AM/download/CaptureDesktopActivitiesAsMovie.zip [ ^ ]在c#中使用WME编码器但是它收到错误检索具有CLSID的组件的COM类工厂{ 632B606A-BBC6-11D2-A329-006097C4E476}由于以下错误而失败:80040154.在我的系统中有x64位。

任何人都可以帮我完成必须做的事情。

先谢谢

i need to capture/record desktop activities as video using wpf
i getting a solution http://www.c-sharpcorner.com/UploadFile/armoghanasif/CaptureDesktopActivities11122005013755AM/download/CaptureDesktopActivitiesAsMovie.zip[^] using WME encoders in c# but it getting error Retrieving the COM class factory for component with CLSID {632B606A-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154. in my system has x64 bit.
Can anyone help me on what has to be done.
Thanks in Advance

推荐答案

也许以间隔速率捕获桌面会更容易,然后使用插件或外部库将每个图像编码为视频文件。



检查:

http://bytescout.com/products/developer/imagetovideosdk/imagetovideosdk_first_step_with_visual_c_sharp_net.html [ ^ ]



AviFile库的简单C#包装器 [ ^ ]



关于如何捕获你的destop,这很容易。您创建一个具有屏幕大小的位图,然后创建位图中的图形,然后复制屏幕并保存:



Maybe it would be easier to capture the desktop at interval rates, and then encode each image into a video file using a plugin or an external library.

Check those:
http://bytescout.com/products/developer/imagetovideosdk/imagetovideosdk_first_step_with_visual_c_sharp_net.html[^]

A Simple C# Wrapper for the AviFile Library[^]

About how to capture your destop, it's easy. You create a bitmap with the size of the screen, then a Graphics from the bitmap, and then copy the screen and save it:

private void TakeScreenShot()
{
    Bitmap bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);

    Graphics gfxScreenshot = Graphics.FromImage(bmpScreenshot);

    gfxScreenshot.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);

    //Change the ImageFormat to jpeg to save hard disk or keep it in Tiff
    //for higher resolution
    bmpScreenshot.Save("Dependencies\\temp.tif", ImageFormat.Tiff);
    bmpScreenshot = null;
}





您可以虚构地使用VirtualDub等外部程序。也许你可以为它制作一个脚本,并从你的程序中运行它。我知道这不是你打算这样做的方式,但这是另一种方式。



You can adictionally use an external program like VirtualDub. Maybe you can make a script for it, and run it from your program. I know this is not the way you're intended to do it, but it's another way.


这篇关于在wpf / Windows中将桌面屏幕捕获为视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆