public MulticastMjpegReader(IPEndPoint localEndpoint, IPEndPoint cameraEndpoint, ImageReceivedHandler imageReceivedCallback) { this._localEndpoint = localEndpoint; this._cameraEndpoint = cameraEndpoint; this._imageReceivedCallback = imageReceivedCallback; //-- Create the memory streams and reserve the capacity this._streams = new MemoryStream[StreamCacheCount]; for (var i = 0; i < this._streams.Length; i++) { this._streams[i] = new MemoryStream(125 * 1024); } }
public void StartAcquisition(ImageReceivedHandler ImageReceived) { if (null == this.m_Cam) { throw new NullReferenceException("No camera retrieved."); } m_RingBitmap = new RingBitmap(m_RingBitmapSize); m_ImageInUse = true; ImageHandler = ImageReceived; try { m_Cam.OnFrameReceived += new Camera.OnFrameReceivedHandler(m_CamOnFrameReceived);//注册图像接收事件 m_Cam.StartContinuousImageAcquisition(9); //m_Cam.Features["AcquisitionStart"].RunCommand();//作用和上一句相同,但是标准写法是这一句 IsAcquring = true; } catch { } }