• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.CameraWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中iSpyApplication.Controls.CameraWindow的典型用法代码示例。如果您正苦于以下问题:C# CameraWindow类的具体用法?C# CameraWindow怎么用?C# CameraWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CameraWindow类属于iSpyApplication.Controls命名空间,在下文中一共展示了CameraWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TextToSpeech

        public TextToSpeech(CameraWindow cw = null)
        {
            InitializeComponent();

            CW = cw;
            Text = LocRm.GetString("TextToSpeech");
            button1.Text = LocRm.GetString("OK");
        }
开发者ID:tdhieu,项目名称:iSpy,代码行数:8,代码来源:TextToSpeech.cs


示例2: SynthToCam

        private static void SynthToCam(string text, CameraWindow cw)
        {
            var synthFormat = new System.Speech.AudioFormat.SpeechAudioFormatInfo(System.Speech.AudioFormat.EncodingFormat.Pcm, 11025, 16, 1, 22100, 2, null);
            using (var synthesizer = new SpeechSynthesizer())
            {
                using (var waveStream = new MemoryStream())
                {

                    //write some silence to the stream to allow camera to initialise properly
                    var silence = new byte[1 * 22050];
                    waveStream.Write(silence, 0, silence.Length);

                    var pbuilder = new PromptBuilder();
                    var pStyle = new PromptStyle
                    {
                        Emphasis = PromptEmphasis.Strong,
                        Rate = PromptRate.Slow,
                        Volume = PromptVolume.ExtraLoud
                    };

                    pbuilder.StartStyle(pStyle);
                    pbuilder.StartParagraph();
                    pbuilder.StartVoice(VoiceGender.Male, VoiceAge.Adult, 2);
                    pbuilder.StartSentence();
                    pbuilder.AppendText(text);
                    pbuilder.EndSentence();
                    pbuilder.EndVoice();
                    pbuilder.EndParagraph();
                    pbuilder.EndStyle();

                    synthesizer.SetOutputToAudioStream(waveStream, synthFormat);
                    synthesizer.Speak(pbuilder);
                    synthesizer.SetOutputToNull();

                    //write some silence to the stream to allow camera to end properly
                    waveStream.Write(silence, 0, silence.Length);
                    waveStream.Seek(0, SeekOrigin.Begin);

                    var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                    var talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, ds); 
                    ds.Start();
                    talkTarget.Start();
                    while (ds.IsRunning)
                    {
                        Thread.Sleep(100);
                    }
                    ds.Stop();
                    talkTarget.Stop();
                    talkTarget = null;
                    ds = null;
                }
            }


        }
开发者ID:tdhieu,项目名称:iSpy,代码行数:55,代码来源:SpeechSynth.cs


示例3: SynthToCam

        private static void SynthToCam(string fileName, CameraWindow cw)
        {
            using (var waveStream = new MemoryStream())
            {

                //write some silence to the stream to allow camera to initialise properly
                var silence = new byte[1 * 22050];
                waveStream.Write(silence, 0, silence.Count());

                //read in and convert the wave stream into our format
                using (var reader = new WaveFileReader(fileName))
                {
                    var newFormat = new WaveFormat(11025, 16, 1);
                    byte[] buff = new byte[22050];

                    using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
                    {
                        do
                        {
                            int i = conversionStream.Read(buff, 0, 22050);
                            waveStream.Write(buff, 0, i);
                            if (i < 22050)
                                break;
                        } while (true);
                    }
                }

                //write some silence to the stream to allow camera to end properly
                waveStream.Write(silence, 0, silence.Count());

                waveStream.Seek(0, SeekOrigin.Begin);

                var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                var talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, ds);

                ds.Start();
                talkTarget.Start();
                while (ds.IsRunning)
                {
                    Thread.Sleep(100);
                }
                ds.Stop();
                talkTarget.Stop();
                talkTarget = null;
                ds = null;

                waveStream.Close();
            }
        }
开发者ID:WesleyYep,项目名称:ispyconnect,代码行数:49,代码来源:AudioSynth.cs


示例4: PTZController

 public PTZController(CameraWindow cameraControl)
 {
     _cameraControl = cameraControl;
 }
开发者ID:huangxuelun,项目名称:iSpy,代码行数:4,代码来源:PTZController.cs


示例5: PTZToolUpdate

 public void PTZToolUpdate(CameraWindow cw)
 {
     if (_ptzTool != null)
     {
         _ptzTool.CameraControl = cw;
     }
 }
开发者ID:flos-club,项目名称:iSpy,代码行数:7,代码来源:MainForm.cs


示例6: ShowFiles

 internal void ShowFiles(CameraWindow cw)
 {
     string foldername = Helper.GetMediaDirectory(2, cw.Camobject.id) + "video\\" + cw.Camobject.directory + "\\";
     if (!foldername.EndsWith(@"\"))
         foldername += @"\";
     Process.Start(foldername);
     cw.Camobject.newrecordingcount = 0;
 }
开发者ID:flos-club,项目名称:iSpy,代码行数:8,代码来源:MainForm.cs


示例7: TalkTo

        public void TalkTo(CameraWindow cw, bool talk)
        {
            if (string.IsNullOrEmpty(Conf.TalkMic))
                return;

            if (_talkSource != null)
            {
                _talkSource.Stop();
                _talkSource = null;
            }
            if (_talkTarget != null)
            {
                _talkTarget.Stop();
                _talkTarget = null;
            }

            if (!talk)
            {
                if (cw.VolumeControl != null)
                {
                    cw.VolumeControl.Listening = false;
                }
                return;
            }
            Application.DoEvents();
            TalkCamera = cw;
            _talkSource = new TalkDeviceStream(Conf.TalkMic) {RecordingFormat = new WaveFormat(8000, 16, 1)};
            _talkSource.AudioFinished += _talkSource_AudioFinished;

            if (!_talkSource.IsRunning)
                _talkSource.Start();

            _talkTarget = TalkHelper.GetTalkTarget(cw.Camobject, _talkSource);
            _talkTarget.TalkStopped += TalkTargetTalkStopped;
            _talkTarget.Start();

            //auto listen
            if (cw.VolumeControl != null)
            {
                cw.VolumeControl.Listening = true;
            }
        }
开发者ID:flos-club,项目名称:iSpy,代码行数:42,代码来源:MainForm.cs


示例8: NewCameraWindow

        private CameraWindow NewCameraWindow(int videoSourceIndex)
        {
            var oc = new objectsCamera
                         {
                             alerts = new objectsCameraAlerts(),
                             detector = new objectsCameraDetector
                                            {
                                                motionzones =
                                                    new objectsCameraDetectorZone
                                                    [0]
                                            },
                             notifications = new objectsCameraNotifications(),
                             recorder = new objectsCameraRecorder(),
                             schedule = new objectsCameraSchedule {entries = new objectsCameraScheduleEntry[0]},
                             settings = new objectsCameraSettings(),
                             ftp = new objectsCameraFtp(),
                             id = -1,
                             directory = RandomString(5),
                             ptz = -1,
                             x = Convert.ToInt32(Random.NextDouble()*100),
                             y = Convert.ToInt32(Random.NextDouble()*100),
                             name = LocRm.GetString("Camera") + " " + NextCameraId
            };
            oc.ptzschedule = new objectsCameraPtzschedule
            {
                active = false,
                entries = new objectsCameraPtzscheduleEntry[] { }
            };
            oc.flipx = oc.flipy = false;
            oc.width = 320;
            oc.height = 240;
            oc.description = "";
            oc.resolution = "320x240";
            oc.newrecordingcount = 0;

            oc.alerts.active = true;
            oc.alerts.mode = "movement";
            oc.alerts.alertoptions = "false,false";
            oc.alerts.objectcountalert = 1;
            oc.alerts.minimuminterval = 180;
            oc.alerts.processmode = "continuous";
            oc.alerts.pluginconfig = "";
            oc.alerts.trigger = "";

            oc.notifications.sendemail = false;
            oc.notifications.sendsms = false;
            oc.notifications.sendmms = false;
            oc.notifications.emailgrabinterval = 0;

            oc.ftp.enabled = false;
            oc.ftp.port = 21;
            oc.ftp.mode = 0;
            oc.ftp.server = "ftp://";
            oc.ftp.interval = 10;
            oc.ftp.filename = "mylivecamerafeed.jpg";
            oc.ftp.localfilename = "{0:yyyy-MM-dd_HH-mm-ss_fff}.jpg";
            oc.ftp.ready = true;
            oc.ftp.text = "www.ispyconnect.com";
            oc.ftp.quality = 75;

            oc.schedule.active = false;

            oc.settings.active = false;
            oc.settings.deleteavi = true;
            oc.settings.ffmpeg = Conf.FFMPEG_Camera;
            oc.settings.emailaddress = EmailAddress;
            oc.settings.smsnumber = MobileNumber;
            oc.settings.suppressnoise = true;
            oc.settings.login = "";
            oc.settings.password = "";
            oc.settings.useragent = "Mozilla/5.0";
            oc.settings.frameinterval = 10;
            oc.settings.sourceindex = videoSourceIndex;
            oc.settings.micpair = -1;
            oc.settings.frameinterval = 200;
            oc.settings.maxframerate = 10;
            oc.settings.maxframeraterecord = 10;
            oc.settings.ptzautotrack = false;
            oc.settings.framerate = 10;
            oc.settings.timestamplocation = 1;
            oc.settings.ptztimetohome = 100;
            oc.settings.ptzchannel = "0";
            oc.settings.timestampformatter = "FPS: {FPS} {0:G} ";
            oc.settings.timestampfontsize = 10;
            oc.settings.notifyondisconnect = false;
            oc.settings.ptzautohomedelay = 30;
            oc.settings.accessgroups = "";

            oc.settings.youtube = new objectsCameraSettingsYoutube
            {
                autoupload = false,
                category = Conf.YouTubeDefaultCategory,
                tags = "iSpy, Motion Detection, Surveillance",
                @public = false
            };
            oc.settings.desktopresizeheight = 480;
            oc.settings.desktopresizewidth = 640;
            oc.settings.resize = false;

            if (VlcHelper.VlcInstalled)
//.........这里部分代码省略.........
开发者ID:vmail,项目名称:main,代码行数:101,代码来源:MainForm_Configuration.cs


示例9: RemoveCameraPanel

        private void RemoveCameraPanel(CameraWindow cameraControl)
        {
            _pnlCameras.Controls.Remove(cameraControl);
            if (!_closing)
            {
                CameraWindow control = cameraControl;
                var oc = Cameras.FirstOrDefault(p => p.id == control.Camobject.id);
                if (oc != null)
                {
                    lock (ThreadLock)
                    {
                        Masterfilelist.RemoveAll(p => p.ObjectId == oc.id && p.ObjectTypeId == 2);
                    }
                    Actions.RemoveAll(p => p.objectid == control.Camobject.id && p.objecttypeid == 2);
                    Cameras.Remove(oc);
                }

                foreach (var ofp in FloorPlans)
                    ofp.needsupdate = true;

                NeedsSync = true;
                SetNewStartPosition();
            }
            Application.DoEvents();
            cameraControl.Dispose();
            if (!_shuttingDown)
            {
                LoadPreviews();
            }
        }
开发者ID:Jaejoon,项目名称:iSpy,代码行数:30,代码来源:MainForm_Configuration.cs


示例10: DisplayCamera

        internal void DisplayCamera(objectsCamera cam)
        {
            var cameraControl = new CameraWindow(cam);
            SetCameraEvents(cameraControl);
            cameraControl.BackColor = Conf.BackColor.ToColor();
            _pnlCameras.Controls.Add(cameraControl);
            cameraControl.Location = new Point(cam.x, cam.y);
            cameraControl.Size = new Size(cam.width, cam.height);
            cameraControl.BringToFront();
            cameraControl.Tag = GetControlIndex();

            if (Conf.AutoSchedule && cam.schedule.active && cam.schedule.entries.Any())
            {
                cam.settings.active = false;
                cameraControl.ApplySchedule();
            }
            else
            {
                try
                {
                    if (cam.settings.active)
                        cameraControl.Enable();
                }
                catch (Exception ex)
                {
                    Log.Error("", ex);
                }
            }

            string path = Conf.MediaDirectory + "video\\" + cam.directory + "\\";
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);
            path = Conf.MediaDirectory + "video\\" + cam.directory + "\\thumbs\\";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
                //move existing thumbs into directory
                var lfi =
                    Directory.GetFiles(Conf.MediaDirectory + "video\\" + cam.directory + "\\", "*.jpg").ToList();
                foreach (string file in lfi)
                {
                    string destfile = file;
                    int i = destfile.LastIndexOf(@"\", StringComparison.Ordinal);
                    destfile = file.Substring(0, i) + @"\thumbs" + file.Substring(i);
                    File.Move(file, destfile);
                }
            }
            path = Conf.MediaDirectory + "video\\" + cam.directory + "\\grabs\\";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
        }
开发者ID:vmail,项目名称:main,代码行数:53,代码来源:MainForm_Configuration.cs


示例11: RemoveCamera

        public void RemoveCamera(CameraWindow cameraControl, bool confirm)
        {
            if (confirm &&
                MessageBox.Show(LocRm.GetString("AreYouSure"), LocRm.GetString("Confirm"), MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.Cancel)
                return;
            cameraControl.ShuttingDown = true;
            cameraControl.MouseDown -= CameraControlMouseDown;
            cameraControl.MouseUp -= CameraControlMouseUp;
            cameraControl.MouseMove -= CameraControlMouseMove;
            cameraControl.DoubleClick -= CameraControlDoubleClick;
            cameraControl.RemoteCommand -= CameraControlRemoteCommand;
            cameraControl.Notification -= ControlNotificationHandler;
            if (cameraControl.Recording)
                cameraControl.RecordSwitch(false);

            cameraControl.Disable();
            cameraControl.SaveFileList();

            if (cameraControl.VolumeControl != null)
                RemoveMicrophone(cameraControl.VolumeControl, false);

            if (InvokeRequired)
                Invoke(new CameraCommandDelegate(RemoveCameraPanel), cameraControl);
            else
                RemoveCameraPanel(cameraControl);
        }
开发者ID:WesleyYep,项目名称:ispyconnect,代码行数:27,代码来源:CameraPanel.cs


示例12: Say

 public static void Say(string text,CameraWindow cw)
 {
     var t = new Thread(() => SynthToCam(Uri.UnescapeDataString(text), cw));
     t.Start();
 }
开发者ID:tdhieu,项目名称:iSpy,代码行数:5,代码来源:SpeechSynth.cs


示例13: Play

 public static void Play(string fileName,CameraWindow cw)
 {
     var t = new Thread(() => SynthToCam(fileName, cw));
     t.Start();
 }
开发者ID:WesleyYep,项目名称:ispyconnect,代码行数:5,代码来源:AudioSynth.cs


示例14: SynthToCam

        private static void SynthToCam(string fileName, CameraWindow cw)
        {
            using (var waveStream = new MemoryStream())
            {

                //write some silence to the stream to allow camera to initialise properly
                var silence = new byte[1 * 22050];
                waveStream.Write(silence, 0, silence.Count());

                //read in and convert the wave stream into our format
                using (var reader = new WaveFileReader(fileName))
                {
                    var newFormat = new WaveFormat(11025, 16, 1);
                    byte[] buff = new byte[22050];

                    using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
                    {
                        do
                        {
                            int i = conversionStream.Read(buff, 0, 22050);
                            waveStream.Write(buff, 0, i);
                            if (i < 22050)
                                break;
                        } while (true);
                    }
                }

                //write some silence to the stream to allow camera to end properly
                waveStream.Write(silence, 0, silence.Count());

                waveStream.Seek(0, SeekOrigin.Begin);

                ITalkTarget talkTarget;

                var ds = new DirectStream(waveStream) { RecordingFormat = new WaveFormat(11025, 16, 1) };
                switch (cw.Camobject.settings.audiomodel)
                {
                    case "Foscam":
                        ds.Interval = 40;
                        ds.PacketSize = 882; // (40ms packet at 22050 bytes per second)
                        talkTarget = new TalkFoscam(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport,
                                                    cw.Camobject.settings.audiousername,
                                                    cw.Camobject.settings.audiopassword, ds);
                        break;
                    case "NetworkKinect":
                        ds.Interval = 40;
                        ds.PacketSize = 882;
                        talkTarget = new TalkNetworkKinect(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport, ds);
                        break;
                    case "iSpyServer":
                        ds.Interval = 40;
                        ds.PacketSize = 882;
                        talkTarget = new TalkiSpyServer(cw.Camobject.settings.audioip,
                                                        cw.Camobject.settings.audioport,
                                                        ds);
                        break;
                    case "Axis":
                        talkTarget = new TalkAxis(cw.Camobject.settings.audioip, cw.Camobject.settings.audioport,
                                                    cw.Camobject.settings.audiousername,
                                                    cw.Camobject.settings.audiopassword, ds);
                        break;
                    default:
                        //local playback
                        talkTarget = new TalkLocal(ds);

                        break;
                }
                ds.Start();
                talkTarget.Start();
                while (ds.IsRunning)
                {
                    Thread.Sleep(100);
                }
                ds.Stop();
                if (talkTarget != null)
                    talkTarget.Stop();
                talkTarget = null;
                ds = null;

                waveStream.Close();
            }
        }
开发者ID:WildGenie,项目名称:ispyconnect,代码行数:82,代码来源:AudioSynth.cs


示例15: ConfigureProcessorForm

 public ConfigureProcessorForm(CameraWindow CW)
 {
     InitializeComponent();
     RenderResources();
     CameraControl = CW;
 }
开发者ID:vmail,项目名称:main,代码行数:6,代码来源:ConfigureProcessorForm.cs


示例16: OpenVideoSource

        private void OpenVideoSource(CameraWindow cw)
        {
            cw.CameraReconnect -= CWCameraReconnect;
            cw.CameraDisabled -= CWCameraDisabled;
            cw.CameraReconnected -= CWCameraReconnected;
            cw.CameraEnabled -= CWCameraEnabled;

            cw.CameraReconnect += CWCameraReconnect;
            cw.CameraDisabled += CWCameraDisabled;
            cw.CameraReconnected += CWCameraReconnected;
            cw.CameraEnabled += CWCameraEnabled;
            cw.HasClones = true;

            bool opened = false;
            if (cw.Camera?.VideoSource != null)
            {
                var source = cw.Camera.VideoSource;
                Camera = new Camera(source);

                Camera.NewFrame -= CameraNewFrame;
                Camera.PlayingFinished -= VideoDeviceVideoFinished;
                Camera.Alarm -= Alarm;
                Camera.ErrorHandler -= CameraWindow_ErrorHandler;
                    
                Camera.NewFrame += CameraNewFrame;
                Camera.PlayingFinished += VideoDeviceVideoFinished;
                Camera.Alarm += Alarm;
                Camera.ErrorHandler += CameraWindow_ErrorHandler;
              
                Calibrating = true;
                _lastRun = Helper.Now.Ticks;
                Camera.Start();
                if (cw.VolumeControl != null && !Camobject.settings.ignoreaudio)
                {
                    if (Camobject.id == -1)
                    {
                        Camobject.id = MainForm.NextCameraId;
                        MainForm.Cameras.Add(Camobject);
                    }
                    var vl = VolumeControl;
                    if (vl == null)
                    {
                        vl = MainForm.InstanceReference.AddCameraMicrophone(Camobject.id, Camobject.name + " mic");
                        Camobject.settings.micpair = vl.Micobject.id;
                    }
                       
                    var m = vl.Micobject;
                    if (m != null)
                    {
                        m.settings.samples = cw.VolumeControl.Micobject.settings.samples;
                        m.settings.channels = cw.VolumeControl.Micobject.settings.channels;
                        m.settings.typeindex = 4;
                        m.settings.buffer = Camobject.recorder.bufferseconds;
                        m.settings.bits = 16;
                        //m.alerts.active = false;
                        //m.detector.recordonalert = false;
                        //m.detector.recordondetect = false;
                    }

                    vl.Disable();
                    vl.Enable();

                    cw.VolumeControl.AudioDeviceEnabled += VLAudioDeviceEnabled;
                        
                }
                opened = true;
            }
            if (!opened)
            {
                SetErrorState("Source camera offline");
                VideoSourceErrorState = true;
                _requestRefresh = true;
            }
        }
开发者ID:tdhieu,项目名称:iSpy,代码行数:74,代码来源:CameraWindow.cs


示例17: RemoveCamera

        public void RemoveCamera(CameraWindow cameraControl, bool confirm)
        {
            if (confirm &&
                MessageBox.Show(LocRm.GetString("AreYouSure"), LocRm.GetString("Confirm"), MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.Cancel)
                return;

            var dr = DialogResult.No;
            if (confirm)
            {
                dr = MessageBox.Show(LocRm.GetString("DeleteAllAssociatedMedia"), LocRm.GetString("Confirm"),
                    MessageBoxButtons.YesNoCancel,
                    MessageBoxIcon.Question);
            }
            if (dr == DialogResult.Cancel)
                return;

            string folder = cameraControl.Dir.Entry + "video\\" + cameraControl.Camobject.directory + "\\";

            cameraControl.ShuttingDown = true;
            cameraControl.MouseDown -= CameraControlMouseDown;
            cameraControl.MouseUp -= CameraControlMouseUp;
            cameraControl.MouseMove -= CameraControlMouseMove;
            cameraControl.DoubleClick -= CameraControlDoubleClick;
            cameraControl.RemoteCommand -= CameraControlRemoteCommand;
            cameraControl.Notification -= ControlNotification;
            if (cameraControl.Recording)
                cameraControl.RecordSwitch(false);

            cameraControl.Disable();
            cameraControl.SaveFileList();

            if (cameraControl.VolumeControl != null)
                RemoveMicrophone(cameraControl.VolumeControl, false);

            if (InvokeRequired)
                Invoke(new Delegates.CameraCommandDelegate(RemoveCameraPanel), cameraControl);
            else
                RemoveCameraPanel(cameraControl);

            if (dr == DialogResult.Yes)
            {
                try
                {
                    Directory.Delete(folder, true);
                }
                catch (Exception ex)
                {
                    LogExceptionToFile(ex);
                }
            }
        }
开发者ID:Jaejoon,项目名称:iSpy,代码行数:52,代码来源:MainForm_Configuration.cs


示例18: RemoveCameraPanel

        private void RemoveCameraPanel(CameraWindow cameraControl)
        {
            _pnlCameras.Controls.Remove(cameraControl);
            if (!MainForm._closing)
            {
                CameraWindow control = cameraControl;
                var oc = MainForm.Cameras.FirstOrDefault(p => p.id == control.Camobject.id);
                if (oc != null)
                {
                    if (ObjectRemoved != null)
                    {
                        ObjectRemoved(this, new ObjectEventArgs(2, oc.id));
                    }

                    MainForm.Cameras.Remove(oc);
                }

                foreach (var ofp in MainForm.FloorPlans)
                    ofp.needsupdate = true;

                MainForm.NeedsSync = true;
                SetNewStartPosition();
            }
            Application.DoEvents();
            cameraControl.Dispose();
            if (!MainForm._closing)
            {
                //LoadPreviews();
            }
        }
开发者ID:WesleyYep,项目名称:ispyconnect,代码行数:30,代码来源:CameraPanel.cs


示例19: RemoveCameraPanel

        private void RemoveCameraPanel(CameraWindow cameraControl)
        {
            _pnlCameras.Controls.Remove(cameraControl);
            if (!_closing)
            {
                CameraWindow control = cameraControl;
                objectsCamera oc = Cameras.FirstOrDefault(p => p.id == control.Camobject.id);
                if (oc != null)
                    Cameras.Remove(oc);

                NeedsSync = true;
                SetNewStartPosition();
            }
            Application.DoEvents();
            cameraControl.Dispose();
            if (!_shuttingDown)
            {
                LoadPreviews();
            }
        }
开发者ID:vmail,项目名称:main,代码行数:20,代码来源:MainForm_Configuration.cs


示例20: DisplayCamera

        public void DisplayCamera(objectsCamera cam, bool enableOnDisplay = false)
        {
            var cameraControl = new CameraWindow(cam,this);
            SetCameraEvents(cameraControl);
            cameraControl.BackColor = Conf.BackColor.ToColor();
            _pnlCameras.Controls.Add(cameraControl);
            cameraControl.Location = new Point(cam.x, cam.y);
            cameraControl.Size = new Size(cam.width, cam.height);
            cameraControl.BringToFront();
            cameraControl.Tag = GetControlIndex();

            var dir = Helper.GetMediaDirectory(2, cam.id);
            string path = dir + "video\\" + cam.directory + "\\";
            try
            {
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
                path = dir + "video\\" + cam.directory + "\\thumbs\\";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                    //move existing thumbs into directory
                    var lfi =
                        Directory.GetFiles(dir + "video\\" + cam.directory + "\\", "*.jpg").ToList();
                    foreach (string file in lfi)
                    {
                        string destfile = file;
                        int i = destfile.LastIndexOf(@"\", StringComparison.Ordinal);
                        destfile = file.Substring(0, i) + @"\thumbs" + file.Substring(i);
                        File.Move(file, destfile);
                    }
                }
                path = dir + "video\\" + cam.directory + "\\grabs\\";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }
            catch (Exception ex)
            {
                LogExceptionToFile(ex);
            }
            if (enableOnDisplay)
                cameraControl.Enable();
            cameraControl.GetFiles();
        }
开发者ID:Jaejoon,项目名称:iSpy,代码行数:46,代码来源:MainForm_Configuration.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# text.BaseColor类代码示例发布时间:2022-05-26
下一篇:
C# DataContract.Application类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap