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


C# Device.Stop方法代码示例

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


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

示例1: activatecam

 private bool activatecam()
 {
     if (cmbDevices.SelectedIndex != -1)
     {
         PrimeraCamara = DeviceManager.GetDevice(cmbDevices.SelectedIndex); PrimeraCamara.Stop();
         PrimeraCamara = DeviceManager.GetDevice(cmbDevices.SelectedIndex);
         PrimeraCamara.ShowWindow(this.picCapture);
     }
     return true;
 }
开发者ID:Khanzo,项目名称:Arduino_Pj,代码行数:10,代码来源:stepper_table2.ino.cs

示例2: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                int agl = Convert.ToInt32(tbStep.Text.ToString().Trim());
                if (agl <= 0) { MessageBox.Show("Угол не верено задан."); return; }
                int step = Convert.ToInt32(360 / agl);
                if (step > 360) { MessageBox.Show("Угол не верено задан."); return; }
                label5.Text = Convert.ToString(step);

                string s = comboBox1.Text.ToString().Trim();
                string filename = "";
                if (cmbDevices.SelectedIndex != -1)
                {
                    PrimeraCamara = DeviceManager.GetDevice(cmbDevices.SelectedIndex);
                    string g = Guid.NewGuid().ToString();

                    System.IO.Directory.CreateDirectory(g);

                    System.Threading.Thread.Sleep(2000);
                    //------------table stepper
                    serialPort1.PortName = s; serialPort1.BaudRate = 9600;
                    serialPort1.Open();
                    serialPort1.Write("#" + Convert.ToString(agl) + ";");
                    serialPort1.Close();
                    System.Threading.Thread.Sleep(1000);

                    for (int i = 0; i < step; i++)
                    {
                        //------------web shot
                        filename = g + "\\shot_" + i.ToString() + ".jpg";

                        picCapture.Image = null;
                        picCapture.Image = PrimeraCamara.grabbmp();
                        PrimeraCamara.Stop();
                        picCapture.Image.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
                        Application.DoEvents();
                        if (activatecam())
                        {
                            System.Threading.Thread.Sleep(2000);
                            //------------table stepper
                            serialPort1.PortName = s; serialPort1.BaudRate = 9600;
                            serialPort1.Open();
                            serialPort1.Write("1");
                            serialPort1.Close();
                            System.Threading.Thread.Sleep(1000);
                        }

                    }
                    serialPort1.PortName = s; serialPort1.BaudRate = 9600;
                    serialPort1.Open();
                    serialPort1.Write("!");
                    serialPort1.Close();

                    MessageBox.Show("Завершено.");
                }
            }catch(Exception ex){MessageBox.Show("Ошибка."+ex.Message.ToString());}
        }
开发者ID:Khanzo,项目名称:Arduino_Pj,代码行数:58,代码来源:stepper_table2.ino.cs

示例3: button3_Click

 private void button3_Click(object sender, EventArgs e)
 {
     if (cmbDevices.SelectedIndex != -1)
     {
         PrimeraCamara = DeviceManager.GetDevice(cmbDevices.SelectedIndex);
         picCapture.Image = null;
         picCapture.Image = PrimeraCamara.grabbmp();
         PrimeraCamara.Stop();
         picCapture.Image.Save("1.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
         PrimeraCamara.Stop();
         activatecam();
     }
 }
开发者ID:Khanzo,项目名称:Arduino_Pj,代码行数:13,代码来源:stepper_table2.ino.cs


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