如何使用框架和计时器创建视频背景?
问题描述:
我尝试使用视频中的帧创建视频背景,并使用计时器来运行帧30FPS,有人可以帮助我吗?它是一个学校项目。
即时通讯到目前为止,我可以使用轨迹栏进行此工作,但使用计时器自动刷新背景30FPS会更酷#= 。
Im trying to create a video background using frames from a video, and using a timer to run the frames 30FPS , can someone help me out? its for a school project.
im here so far, i can make this work with a trackbar, but using a timer to automatically refresh the background 30FPS would be a lot more cool =).
展开 | 选择 | Wrap | 行号
答
我们真的不能为你做功课,但是我们可以帮到你。
你对计时器有什么具体的问题?
这里有点值得尝试..在你的表格上,放下一个计时器。将间隔设置为1000(毫秒,1秒)。将一个处理程序附加到tick事件并在其中放置一些可见的东西,可能是Console.WriteLine(Ticked!);
希望这有足够的提示让你开始:)
We can''t really do your homework for you, but we can help you out.
What question specifically do you have about a timer?
Here''s something to try... on your form, drop down a timer. Set the interval to say, 1000 (milliseconds, 1 second). Attach a handler to the tick event and put something visible in there, maybe a Console.WriteLine("Ticked!");
Hopefully that''s enough hint to get you started :)
@GaryTexmo
=)好吧我已经做到了,但我的问题这里更像是我如何把计时器搜索到图像[i]并以30 FPS的速度显示图像,但我的主要问题是怎么说在timer1_tick上(就像间隔一样),我真的不知道从哪里开始,我尝试了我在谷歌上找到的所有东西,但仍然没有结果,请给我一个亮点=)
@GaryTexmo
=) okay i already done that, but my question here is more like how do i put the timer to search the image[i] and show the images on a speed of 30 FPS, but my main problem is how to say that on the timer1_tick(like the interval), i really dont know where to start, i tried everything that i found on google and still had no results,please give me a light =)
两件事......
1)如果你想要在阵列中运行图像,你将需要某种计数器,对吧?这里的类成员变量可能是合适的......我的意思是,图像[i]是什么?你是通过for循环访问它的,对吗?好吧,你有点想用计时器本身替换你的for循环...
2)FPS究竟是什么意思?每秒帧数。如果你每秒有30帧,那么每帧会有多少秒?计时器上的哪个位置可以输入与秒数有关的金额?
(希望你能朝正确的方向推动你。你已经明确说明了你想做什么,你''我只需要玩一个计时器来学习如何利用它来发挥作用。)
Two things...
1) If you want to run through an image in an array, you''d going to need some kind of counter, right? A class member variable might be appropriate here... What I mean by this is, what is images[i]? You''re accessing it via a for loop, right? Well, you kind of want to replace your for loop with the timer itself...
2) What does FPS actually mean? Frames per second. If you had 30 frames per second, how many seconds would it be per frame? Where on the timer can you enter an amount relating to seconds?
(Hopefully that nudges ya in the right direction. You''ve clearly stated what you want to do, you''ve just gotta play around with a timer to learn how you can use it to your advantage.)