/// <summary> /// Event Handler for btnTakePhotoWithCamera.Click event. /// Get Webcam Image. Set pictureBoxPhoto Image and Tag to bytearray of Image. /// </summary> /// <param name="sender">Sender of event</param> /// <param name="e">Event arguments</param> private void BtnTakePhotoWithCamera_Click(object sender, EventArgs e) { Bitmap webcamBitmap = ImageFunctions.GetBitmapFromWebcam(); // if null, there was a problem getting webcamBitmap // if not null, set pictureBoxPhoto Image and Tag if (webcamBitmap != null) { pictureBoxPhoto.Image = webcamBitmap; pictureBoxPhoto.Tag = ImageFunctions.GetByteArrayFromBitMapImage(webcamBitmap); } }