コード例 #1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            // open it for saving
            MJPEGStream mjpegSource = new MJPEGStream(Url);

            OpenVideoSource(mjpegSource, videoKind.stream, true);
            play = playKind.save;
        }
コード例 #2
0
 private void format_SXGA_Click(object sender, EventArgs e)
 {
     try
     {
         CameraClient.Connect(IP_CameraBoard, portoutCAN);
     }
     catch (Exception exception)
     {
         MessageBox.Show("Format SXGA: " + exception.Message);
     }
     M_SEND[0x05] = (byte)framesize_t.FRAMESIZE_SXGA;
     CameraClient.Send(M_SEND, lngFrame);
     play = playKind.format_SXGA;
 }
コード例 #3
0
        private void fromCamera()
        {
            while (true)
            {
                IPEndPoint remoteIPEndPoint = new IPEndPoint(IPAddress.Any, portinCAN);
                try
                {
                    byte[] content = CameraServer.Receive(ref remoteIPEndPoint);
                    if (content.Length > 0)
                    {
                        // Das Programm reagiert auf die Erkennung
                        switch (content[0x01])
                        {
                        case 0x89:
                            Url = "http://" + remoteIPEndPoint.Address.ToString() + ":81/stream";
                            // create video source
                            MJPEGStream mjpegSource = new MJPEGStream(Url);
                            capturePicture = false;
                            if (content[0x06] == 0x00)
                            {
                                setToolTip((byte)buttonNo.xga, "Format nur mit PSRAM verfügbar");
                                setToolTip((byte)buttonNo.sxga, "Format nur mit PSRAM verfügbar");
                                PSRAM = false;
                            }
                            else
                            {
                                setToolTip((byte)buttonNo.xga, formatArray[(int)framesize_t.FRAMESIZE_XGA]);
                                setToolTip((byte)buttonNo.sxga, formatArray[(int)framesize_t.FRAMESIZE_SXGA]);
                                PSRAM = true;
                            }
                            // open it
                            switch (content[0x05])
                            {
                            case 0xFF:
                            case 0x05:         //CIF
                                play = playKind.format_CIF;
                                break;

                            case 0x06:         //VGA
                                play = playKind.format_VGA;
                                break;

                            case 0x07:         //SVGA
                                play = playKind.format_SVGA;
                                break;

                            case 0x08:         //XGA
                                play = playKind.format_XGA;
                                break;

                            case 0x09:         //SXGA
                                play = playKind.format_SXGA;
                                break;

                            default:
                                MessageBox.Show("Falsches Format");
                                break;
                            }
                            setTextBox(formatArray[content[0x05]]);
                            this.videoSourcePlayer.Invoke(new MethodInvoker(() => OpenVideoSource(mjpegSource, videoKind.stream, false)));
                            break;
                        }
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("Threat-Exception: " + e.Message);
                }
            }
        }