当前位置: 首页>>代码示例>>C#>>正文


C# AviWriter.avi_start方法代码示例

本文整理汇总了C#中AviWriter.avi_start方法的典型用法代码示例。如果您正苦于以下问题:C# AviWriter.avi_start方法的具体用法?C# AviWriter.avi_start怎么用?C# AviWriter.avi_start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AviWriter的用法示例。


在下文中一共展示了AviWriter.avi_start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CaptureDone

        private void CaptureDone(System.Drawing.Bitmap e)
        {
            const float parse_fps = 10.0f;
            float video_fps = me.fpsVideo;
            long max_size = me.trocearTamMB*1048576;
           
            
            if (saving_picture)
            {
                saving_picture = false;

                string path = me.PicturePath;
                if (path != null && path != "")
                {
                    DateTime dt = DateTime.Now;

                    if (!Directory.Exists(path))
                        Directory.CreateDirectory(path);

                    string filename = path + "\\PIC_"
                        + dt.Year.ToString("00") + dt.Month.ToString("00") + dt.Day.ToString("00")
                        + "-" + dt.Hour.ToString("00") + dt.Minute.ToString("00") + dt.Second.ToString("00") + ".jpg";

                    try
                    {
                        e.Save(filename, ImageFormat.Jpeg);
                    }
                    catch (Exception) { }
                }

            }

            if (starting_video)
            {
                starting_video = false;
                
                string path = me.VideosPath;
                if (path != null && path != "")
                {
                    DateTime dt = DateTime.Now;

                    if (!Directory.Exists(path))
                        Directory.CreateDirectory(path);

                    string filename = path + "\\VID_"
                        + dt.Year.ToString("00") + dt.Month.ToString("00") + dt.Day.ToString("00")
                        + "-" + dt.Hour.ToString("00") + dt.Minute.ToString("00") + dt.Second.ToString("00")+".avi";

                    avi_writer = new AviWriter();
                    avi_writer.avi_start(filename);

                    saving_video = true;
                    button15.Image = UAVConsole.Properties.Resources.video_red;
                }

            }
            else if (stoping_video)
            {
                saving_video = false;
                stoping_video = false;
                avi_writer.avi_close();
                avi_writer = null;
                
            }
            else if (saving_video && DateTime.Now.Ticks > video_last_tick)
            {
                video_last_tick = DateTime.Now.Ticks + (long)(TimeSpan.TicksPerSecond / video_fps);
                if (me.trocearVideo && max_size > 0 && avi_writer.current_lenght > max_size)
                {
                    avi_writer.avi_close();
                    avi_writer = new AviWriter();
                    DateTime dt = DateTime.Now;

                    string filename = me.VideosPath + "\\VID_"
                       + dt.Year.ToString("00") + dt.Month.ToString("00") + dt.Day.ToString("00")
                       + "-" + dt.Hour.ToString("00") + dt.Minute.ToString("00") + dt.Second.ToString("00") + ".avi";
                    avi_writer.avi_start(filename);
                }
                    avi_writer.SaveFrame(e, me.calidadVideo);
              
            }

            if (modem is ModemVideo && DateTime.Now.Ticks > parse_last_tick)
            {
                parse_last_tick = DateTime.Now.Ticks + (long)(TimeSpan.TicksPerSecond / parse_fps);
                ((ModemVideo)modem).SetImage(e);
            }

            capture.GrapImg2();
        }
开发者ID:rajeper,项目名称:ikarus-osd,代码行数:90,代码来源:FormIkarusMain.cs

示例2: recordHudToAVIToolStripMenuItem_Click

        private void recordHudToAVIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            stopRecordToolStripMenuItem_Click(sender, e);

            CustomMessageBox.Show("Output avi will be saved to the log folder");

            aviwriter = new AviWriter();
            Directory.CreateDirectory(MainV2.LogDir);
            aviwriter.avi_start(MainV2.LogDir + Path.DirectorySeparatorChar +
                                DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".avi");

            recordHudToAVIToolStripMenuItem.Text = "Recording";
        }
开发者ID:Viousa,项目名称:MissionPlanner,代码行数:13,代码来源:FlightData.cs

示例3: recordHudToAVIToolStripMenuItem_Click

        private void recordHudToAVIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            stopRecordToolStripMenuItem_Click(sender, e);

            MessageBox.Show("Output avi will be saved to the log folder");

            aviwriter = new AviWriter();
            Directory.CreateDirectory(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + @"logs");
            aviwriter.avi_start(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + @"logs" + Path.DirectorySeparatorChar + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + ".avi");

            recordHudToAVIToolStripMenuItem.Text = "Recording";
        }
开发者ID:415porto,项目名称:ardupilotone,代码行数:12,代码来源:FlightData.cs


注:本文中的AviWriter.avi_start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。