Visual C# - Visual Studio 2017:如何在Visual C#中将.jpg图像转换为视频# [英] Visual C# - Visual Studio 2017: How do you convert .jpg images to video in Visual C#

查看:212
本文介绍了Visual C# - Visual Studio 2017:如何在Visual C#中将.jpg图像转换为视频#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简介:

您好!我正在尝试制作一个程序,它会拍摄一堆计算机屏幕的照片并将这些照片转换成视频!我正在尝试让程序像一个延时屏幕录像机,所以我可以拍摄时间推移视频,让我在计算机上做某些
的事情,比如编码,建模等等。我正在编写程序使用Visual Studio 2017中的Visual C#。

Hello! I am trying to make a program that takes a bunch of pictures of your computer screen and converts those pictures into a video! I'm trying to make the program be like a time-lapse screen recorder so I can take time lapse videos of me doing certain things on my computer like coding, modeling, etc.  I am writing the program using Visual C# in Visual Studio 2017.

我做了多少:

我让我的程序能够拿一堆电脑屏幕的图片并将它们存放在一个文件夹中。我也做了这样,用户可以使用计时器改变图片之间的延迟,并改变计时器的滴答之间的间隔。
我还没有找到一种方法将所有这些图片放在文件夹中,并将其转换为某种我可以与他人分享的视频。

I made my program be able to take a bunch of pictures of the computer screen and store them in a folder. I have also made it so the user can change the delay in between the pictures using a timer and changing the interval between the ticks of the timer. I haven't found a way to take all of those pictures inside the folder and turn those into some sort of video that I can share with others.

我需要找到什么:

我正在寻找一种方法,当我点击我的程序上的按钮时,它将把文件夹中的所有图像转为转所有这些图像都变成了一个30fps的视频。

I am looking for a way for when I hit a button on my program, it will take all of the images inside a folder and turn all of those images into a 30fps video.

我所追求的代码:

我不喜欢不知道它是否重要但我会在这里粘贴我的所有代码,让你知道到目前为止我在做什么。

I don't know if it matters or not but I am going to paste all of my code here to give you an idea of what I'm doing so far.

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace program_name { public partial class Form1 : Form { public int PictureNumber = 0; public int CaptureInterval = 100; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { timer1.Start(); button2.Enabled = true; button1.Enabled = false; } private void button2_Click(object sender, EventArgs e) { PictureNumber = 0; timer1.Stop(); button1.Enabled = true; button2.Enabled = false; } private void button3_Click(object sender, EventArgs e) { CaptureInterval += 100; label2.Text = CaptureInterval.ToString(); timer1.Interval = CaptureInterval; } private void button4_Click(object sender, EventArgs e) { if (CaptureInterval > 100) { CaptureInterval -= 100; label2.Text = CaptureInterval.ToString(); timer1.Interval = CaptureInterval; } } private void timer1_Tick(object sender, EventArgs e) { PictureNumber += 1; SendKeys.Send("{PRTSC}"); Image img = Clipboard.GetImage(); img.Save("D:\\Pictures\\image" + PictureNumber + ".jpg"); pictureBox1.Image = img; } } }

结束:

如果你能帮助我完成我的课程,我会非常感激。当有人用正确答案回答我的帖子时,我仍然非常高兴。请将我链接到某个帖子或视频,无论是您还是其他人,只需要b $ b b。此外,这篇文章的答案甚至可以做到。如果您不知道自己在说什么,请发布有用的内容,不要说些什么。感谢您阅读我的帖子,对不起,如果我给了您太多的信息,但我相信
最好是太多而不是太多。如果你能帮助我完成你的项目,谢谢你。我希望你们所有人都有一个非常棒的日子:)

If you could help me with my program, I would deeply appreciate it. I still get super happy when someone answers my posts with a right answer. Please link me to some sort of post or a video that either you or someone else made. Also, just an answer on this post would even do. Just please post something useful and don't say something if you don't know what you are talking about. Thank you for reading my post and sorry if I gave you too much information but I believe it's better to have too much than too little. And thank you if you can help me with your project. I hope all of you have an awesome day :)

推荐答案

.NET没有内置的支持来创建视频。您需要找到第三方库,以帮助您以您想要生成的任何格式创建视频。这些库的支持需要来自编写它的开发人员。
.NET does not have built in support for creating videos. You'll need to find a third party library to help you create the video in whatever format(s) you want to generate. Support for those libraries will need to come from the developer(s) who wrote it.


这篇关于Visual C# - Visual Studio 2017:如何在Visual C#中将.jpg图像转换为视频#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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