void Imager_CameraEvent(object sender, CameraEventArgs e) { //MessageBox.Show(e.Message, "Camera: ", MessageBoxButton.OK, MessageBoxImage.Error); VM.IsImaging = e.CameraImaging; if (VM.IsImaging) { Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action( delegate() { StopPB.Visibility = Visibility.Visible; SnapShotPB.Visibility = Visibility.Collapsed; VideoPB.Visibility = Visibility.Collapsed; } )); } else { Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action( delegate() { StopPB.Visibility = Visibility.Collapsed; SnapShotPB.Visibility = Visibility.Visible; VideoPB.Visibility = Visibility.Visible; } )); } }
private void HandleCameraSelect(object sender, CameraEventArgs e) { IPhotoModel photoModel = transform.GetComponent <PhotoController>().GETPhotoModel(); model.ChangeVisibility(false); photoModel.ChangeVisibility(true); }
private void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { if (_viewModel.TakePhotoCommand.CanExecute(null)) { _viewModel.TakePhotoCommand.Execute(null); } }
private void OnCameraChanged(CameraEventArgs obj) { if (obj.MapView == MappingModule.ActiveMapView) { Camera = obj.CurrentCamera; } }
private void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { if (_viewModel.TakePhotoCommand.CanExecute(null)) { _viewModel.TakePhotoCommand.Execute(null); } }
/// <summary> /// 内部公开方法 /// </summary> /// <param name="e"></param> protected virtual void OnImageCaptured(CameraEventArgs e) { if (ImageCaptured != null) { ImageCaptured(this, e); } }
public void ProcessImage(CameraEventArgs args, Point formLocation, Point mouseLocation) { FormLocation = formLocation; MouseLocation = mouseLocation; CheckForMotion(args); ProcessBitmap(args); }
// On new frame private void video_NewFrame(object sender, CameraEventArgs e) { try { // lock Monitor.Enter(this); lastFrame = e.Bitmap; // notify client if (NewFrame != null) { evt = new EventArgs(); NewFrame(this, evt); frames++; } } catch (Exception) { } finally { // unlock Monitor.Exit(this); } }
private async void HardwareButtonsOnCameraHalfPressed(object sender, CameraEventArgs cameraEventArgs) { if (mediaCapture.VideoDeviceController.FocusControl.Supported) { await mediaCapture.VideoDeviceController.FocusControl.FocusAsync(); } }
private void video_NewFrame(object sender, CameraEventArgs e) { try { Monitor.Enter(this); if (this.lastFrame != null) { this.lastFrame.Dispose(); } this.lastFrame = (Bitmap)e.Bitmap.Clone(); this.width = this.lastFrame.Width; this.height = this.lastFrame.Height; } catch (Exception) { } finally { Monitor.Exit(this); } if (this.NewFrame != null) { this.NewFrame(this, new EventArgs()); } }
public void OnCameraUpdate(object sender, CameraEventArgs e) { if (Hidden) { return; } this.scale = e.Camera.CreateScale(origin, 0.5f, pixelSize: 30); var scaleMatrix = Matrix4.CreateScale(scale, scale, scale); var rotationMatrix = Mode == TransformMode.Local ? Matrix4.CreateFromQuaternion(this.rotation) : Matrix4.Identity; this.origin = this.position + Vector3.Transform(new Vector3(0, 0, 0), scaleMatrix * rotationMatrix); this.right = Vector3.Transform(new Vector3(1, 0, 0), scaleMatrix * rotationMatrix); this.forward = Vector3.Transform(new Vector3(0, 1, 0), scaleMatrix * rotationMatrix); this.up = Vector3.Transform(new Vector3(0, 0, 1), scaleMatrix * rotationMatrix); var contactSize = 0.2f * scale; rightContact.CollisionShape = new BulletSharp.SphereShape(contactSize); forwardContact.CollisionShape = new BulletSharp.SphereShape(contactSize); upContact.CollisionShape = new BulletSharp.SphereShape(contactSize); rightContact.WorldTransform = Matrix4.CreateTranslation(this.origin + right); forwardContact.WorldTransform = Matrix4.CreateTranslation(this.origin + forward); upContact.WorldTransform = Matrix4.CreateTranslation(this.origin + up); this.Dispose(false); BufferData(e.Camera); }
// On new frame private void video_NewFrame(object sender, CameraEventArgs e) { // lock Monitor.Enter(this); // dispose old frame if (lastFrame != null) { lastFrame.Dispose(); } lastFrame = (Bitmap)e.Bitmap.Clone(); // image dimension width = lastFrame.Width; height = lastFrame.Height; // unlock Monitor.Exit(this); // notify client if (NewFrame != null) { NewFrame(this, new EventArgs()); } }
// On new frame private void video_NewFrame(object sender, CameraEventArgs e) { try { // lock Monitor.Enter(this); // dispose old frame if (_lastFrame != null) { _lastFrame.Dispose(); } _lastFrame = (Bitmap)e.Bitmap.Clone(); // kalo ada prerendering event, panggil pointer to functionnya if (preRenderingEvent != null) { preRenderingEvent(ref _lastFrame); } _width = _lastFrame.Width; _height = _lastFrame.Height; } catch (Exception) { } finally { // unlock Monitor.Exit(this); } // notify client if (NewFrame != null) { NewFrame(this, new EventArgs()); } }
private void HardwareButtons_CameraHalfPressed(object sender, CameraEventArgs e) { if (!target?.Api?.Capability?.IsAvailable("actHalfPressShutter") ?? true) { return; } target?.Api?.Camera?.ActHalfPressShutterAsync().IgnoreExceptions(); }
void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { if (!pressed) { CaptureImage_Click(this, null); pressed = true; } }
private void C_OnImageCaptured(object sender, CameraEventArgs e) { if (button1.Enabled && uploadclicked == false) { b = e.Image; pictureBox1.Invalidate(); } }
/// <summary> /// Update picture box with the latest frame from video camera /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CurrentCamera_OnImageCaptured(object sender, CameraEventArgs e) { if (MANAGER != null) { Bitmap imagePreview = MANAGER.CurrentCamera.GetCurrentImage(); // resize image into 320x240 and set to the preview pictureVideoPreview.Image = ResizeImage(imagePreview, 320, 240); } }
/// <summary> /// Event handler from the active camera /// </summary> public void OnImageCaptured(object sender, CameraEventArgs args) { if (!_fAddingMarker) { _latestFrame = args.Image; pictureBoxDisplay.Invalidate(); } }
private void OnCameraMoved(CameraEventArgs e) { EventHandler <CameraEventArgs> handler = CameraMoved; if (handler != null) { handler(this, e); } }
/// <summary> /// Event handler from the active camera /// </summary> public void OnImageCaptured(object sender, CameraEventArgs args) { if (!_fAddingMarker) { _latestFrame = args.Image; pictureBoxDisplay.Invalidate(); } }
private CameraEventArgs GetCameraState() { var p = new CameraEventArgs(); p.beingDragged = wasDragged; p.currentPosition = m_cameraPosition.position; p.currentRotation = m_localRotation; return(p); }
private void OnImageCaptured(object sender, CameraEventArgs args) { Bitmap bitmap = args.Image; this.Invoke((MethodInvoker) delegate { webCamBox.Image = bitmap; ReadBarcode(bitmap); }); }
void CurrentCamera_OnImageCaptured(object sender, CameraEventArgs e) { //Giving the feed of the camera to the picturepox variables.Image = manager.CurrentCamera.GetCurrentImage(); pictureBox_Original.Image = variables.Image; //System.Timers.Timer moveTimer = new System.Timers.Timer(); //moveTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent); //moveTimer.Interval = 500; //moveTimer.Enabled = true; }
void Imager_CameraEvent(object sender, CameraEventArgs e) { if (this.Dispatcher.CheckAccess()) { PostMessage(e.Message); } else { this.Dispatcher.BeginInvoke(new Action(() => PostMessage(e.Message))); } }
protected virtual void OnNewImageEvent(CameraEventArgs e) { EventHandler <CameraEventArgs> handler = this.NewImageEvent; if (handler != null) { AsyncCallback nn = new AsyncCallback(eventCallback); handler.BeginInvoke(handler, e, nn, e); //handler(this, e); } }
private async void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { if (CameraStatusUtility.IsContinuousShootingMode(target)) { await StartContShooting(); } else { ShutterButtonPressed(); } }
private void OnImageCaptured(object sender, CameraEventArgs args) { // Get the bitmap Bitmap bitmap = args.Image; // Read barcode and show results in UI thread this.Invoke((MethodInvoker) delegate { pictureBox1.Image = bitmap; ReadBarcode(bitmap); }); }
// On new frame private void video_NewFrame(object sender, CameraEventArgs e) { try { // lock Monitor.Enter(this); // dispose old frame if (lastFrame != null) { lastFrame.Dispose( ); } lastFrame = (Bitmap)e.Bitmap.Clone( ); /* * // apply motion detector * if ( motionDetecotor != null ) * { * motionDetecotor.ProcessFrame( ref lastFrame ); * * // check motion level * if ( * ( motionDetecotor.MotionLevel >= alarmLevel ) && * ( Alarm != null ) * ) * { * Alarm( this, new EventArgs( ) ); * } * }//*/ // image dimension width = lastFrame.Width; height = lastFrame.Height; } catch (Exception) { } finally { // unlock Monitor.Exit(this); } // notify client if (NewFrame != null) { NewFrame(this, new EventArgs( )); } }
// On new frame private void video_NewFrame(object sender, CameraEventArgs e) { // lock Monitor.Enter(this); // dispose old frame if (lastFrame != null) { lastFrame.Dispose(); } lastFrame = (Bitmap)e.Bitmap.Clone(); ////Fernando: DateTime now = DateTime.Now; string timeStamp = now.ToString("yyyyMMddHHmmssfff"); string fileName = "image_" + timeStamp + ".jpg"; lastFrame.Save(@"F:\Development\CPP\RTMP\projects\ffmpeg\bin\img\" + fileName); string filePath = @"F:\Development\CPP\RTMP\projects\ffmpeg\bin\img\images.txt"; //TextWriter tw = new StreamWriter(@"F:\Development\CPP\RTMP\projects\ffmpeg\bin\img\images.txt", true, ); FileStream fileStream = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.ReadWrite); TextWriter textWriter = new StreamWriter(fileStream); textWriter.WriteLine("0|" + timeStamp + "|" + fileName); textWriter.Flush(); textWriter.Close(); fileStream.Close(); //Fernando: FIN // image dimension width = lastFrame.Width; height = lastFrame.Height; // unlock Monitor.Exit(this); // notify client if (NewFrame != null) { NewFrame(this, new EventArgs()); } }
/// <summary> /// Event handler from the active camera /// </summary> public void OnImageCaptured(object sender, CameraEventArgs args) { // Calculate FPS (only update the display once every second) _nFrameCount++; double milliseconds = (DateTime.Now.Ticks - _dtFrameLast.Ticks) / TimeSpan.TicksPerMillisecond; // Save the latest image for drawing if (!_fAddingMarker) { // Cause display update _latestFrame = args.Image; pictureBoxDisplay.Invalidate(); } }
private void OnImageCaptured(object sender, CameraEventArgs args) { Bitmap bitmap = args.Image; try { this.Invoke((MethodInvoker) delegate { pictureBox1.Image = bitmap; ReadBarcode(bitmap); }); } catch { return; } }
private async void HardwareButtons_CameraReleased(object sender, CameraEventArgs e) { if (target == null || target.Api == null) { return; } if (target.Api.Capability.IsAvailable("cancelHalfPressShutter")) { try { await target?.Api?.Camera?.CancelHalfPressShutterAsync(); } catch (RemoteApiException) { } } await StopContShooting(); }
private async void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { await TakePhotoAsync(); }
private void displayFrame(object sender, CameraEventArgs e) { img = e.Image; }
private void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { _adaptiveCodeStatusTextBlock.Text = "CAM CAM CAM CAM CAM CAM CAM CAM CAM CAM CAM CAM CAM CAM!"; }
void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { CameraButtonPressCount++; rootPage.NotifyUser($"Camera button press #{CameraButtonPressCount}", NotifyType.StatusMessage); }
async void OnHardwareCameraButtonPressed(object sender, CameraEventArgs e) { await TakePhotoAsync(); }
void ReceivedNewFrame(object sender, CameraEventArgs e) { fPixelPtr = e.fData; fPixelLength = e.fSize; fSampleTime = e.fTimeStamp; }
public void OnImageCaptured(object sender, CameraEventArgs args) { // Calculate FPS (only update the display once every second) _nFrameCount++; double milliseconds = (DateTime.Now.Ticks - _dtFrameLast.Ticks) / TimeSpan.TicksPerMillisecond; if (milliseconds >= 1000) { this.BeginInvoke(new Action<double>(UpdateFPSInUI), new object[] { _nFrameCount * 1000.0 / milliseconds }); _nFrameCount = 0; _dtFrameLast = DateTime.Now; } double markerWait = (DateTime.Now.Ticks - _latestFrameTime.Ticks) / TimeSpan.TicksPerMillisecond; // Save the latest image for drawing if (!_fAddingMarker) { // Cause display update _latestFrame = args.Image; pictureBoxDisplay.Invalidate(); //set time _latestFrameTime = DateTime.Now; } else if (_fAddingMarker && markerWait <= 5000) { // Cause display update _latestFrame = args.Image; pictureBoxDisplay.Invalidate(); //start timer by not setting time. if (markerWait % 1000 < 250) { _latestFrameTimeSegment = true; } else { _latestFrameTimeSegment = false; } } }
private async void CameraFullPressed(object sender, CameraEventArgs args) { await capturePhoto(); }
private async void OnHardwareButtonsCameraPressed(object sender, CameraEventArgs e) { await CaptureImageAsync(); }
private async void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { MessageDialog dialog = new MessageDialog("Hello from the camera button!"); await dialog.ShowAsync(); }
private void displayImage(object s, CameraEventArgs e) { LifeImage = Camera.ToBitmapSource(e.Image); OnPropertyChanged("LifeImage"); md.findMarkers(e.Image.Convert<Gray, Byte>()); if (md.isMarker()) { CutImage = Camera.ToBitmapSource(md.threshold(md.markers[0].getSymbolImage(), 150, 255)); pictoRecognized = true; } else if (!pictoRecognized) { CutImage = Camera.ToBitmapSource(Properties.Resources.noImage); } OnPropertyChanged("CutImage"); }
private void c_OnImageCaptured(object sender, CameraEventArgs e) { // Calculate FPS (only update the display once every second) ++this.tMgr._nFrameCount; double milliseconds = (DateTime.Now.Ticks - this.tMgr._dtFrameLast.Ticks) / TimeSpan.TicksPerMillisecond; if (milliseconds >= 1000) { //this.BeginInvoke(new Action<double>(UpdateFPSInUI), new object[] { this.tMgr._nFrameCount * 1000.0 / milliseconds }); this.tMgr._nFrameCount = 0; this.tMgr._dtFrameLast = DateTime.Now; } // Save the latest image for drawing if (!this.tMgr._addingMarker) { // Cause display update this.tMgr._latestFrame = e.Image; pictureBoxCamera.Invalidate(); } }
private async void CameraHalfPressed(object sender, CameraEventArgs args) { await camera.VideoDeviceController.FocusControl.FocusAsync(); }
void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { CapturePhoto(); }
private void CameraChanged(CameraEventArgs args) { Camera = args.CurrentCamera; SetHeading(); }
private void OnCameraMoved(CameraEventArgs e) { EventHandler<CameraEventArgs> handler = CameraMoved; if (handler != null) handler(this, e); }
private void OnHardwareButtons_CameraPressed(object sender, CameraEventArgs e) { Task stop = TakePhotoAndStopAsync(); }
void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { if (!pressed) { CaptureImage_Click(this, null); pressed = true; } }
void HardwareButtons_DisableCameraButton(object sender, CameraEventArgs e) { }
void HardwareButtons_CameraHalfPressed(object sender, CameraEventArgs e) { }
private void HardwareButtons_CameraPressed(object sender, CameraEventArgs e) { captureElement(); }
protected void RaiseOnSnapShotEvent(CameraEventArgs args) { if (OnSnapShot != null) { OnSnapShot(this, args); } }
void CurrentCamera_OnImageCaptured(object sender, CameraEventArgs e) { //Giving the feed of the camera to the picturepox picFeed.Image = manager.CurrentCamera.GetCurrentImage(); }
/// <summary> /// Przechwycenie ostatniej klatki, odświerzenie Wspolny.w_pictureboxa /// </summary> private void OnImageCaptured(object sender, CameraEventArgs args) { // Przeliczanie FPS licznikKlatek++; double milliseconds = (DateTime.Now.Ticks - czasOstatniejKlatki.Ticks) / TimeSpan.TicksPerMillisecond; if (milliseconds >= 1000) { Fps= Math.Round((licznikKlatek * 1000.0 / milliseconds),2); licznikKlatek = 0; czasOstatniejKlatki = DateTime.Now; } if (Wspolny.pauza == false) { Wspolny.ostatnia_klatka = args.Image; Wspolny.w_picturebox.Invalidate(); } }
public void OnCameraUpdate(object sender, CameraEventArgs e) { if (Hidden) return; this.scale = e.Camera.CreateScale(origin, 0.5f, pixelSize: 30); var scaleMatrix = Matrix4.CreateScale(scale, scale, scale); var rotationMatrix = Mode == TransformMode.Local ? Matrix4.CreateFromQuaternion(this.rotation) : Matrix4.Identity; this.origin = this.position + Vector3.Transform(new Vector3(0, 0, 0), scaleMatrix * rotationMatrix); this.right = Vector3.Transform(new Vector3(1, 0, 0), scaleMatrix * rotationMatrix); this.forward = Vector3.Transform(new Vector3(0, 1, 0), scaleMatrix * rotationMatrix); this.up = Vector3.Transform(new Vector3(0, 0, 1), scaleMatrix * rotationMatrix); var contactSize = 0.2f * scale; rightContact.CollisionShape = new BulletSharp.SphereShape(contactSize); forwardContact.CollisionShape = new BulletSharp.SphereShape(contactSize); upContact.CollisionShape = new BulletSharp.SphereShape(contactSize); rightContact.WorldTransform = Matrix4.CreateTranslation(this.origin + right); forwardContact.WorldTransform = Matrix4.CreateTranslation(this.origin + forward); upContact.WorldTransform = Matrix4.CreateTranslation(this.origin + up); this.Dispose(false); BufferData(e.Camera); }
void currentCamera_OnImageCaptured(object sender, CameraEventArgs e) { pictureBox1.BackgroundImage = currentCamera.GetCurrentImage(); }
protected int OnNewBuffer(double SampleTime, IntPtr pBuffer, int BufferLen) { if ((!stopEvent.WaitOne(0, true)) && (NewFrame != null)) { CameraEventArgs camEvent = new CameraEventArgs(SampleTime, pBuffer, BufferLen, Width, Height); NewFrame(this, camEvent); } return 0; }
void OnImageCaptured(object sender, CameraEventArgs e) { LatestFrame = e.Image; PictureBox.Invalidate(); }