private void _OnTakeSnapshot() { if (!CWebcam.IsDeviceAvailable()) { CDraw.RemoveTexture(ref _WebcamTexture); _Snapshot = null; _Buttons[_ButtonSaveSnapshot].Visible = false; _Buttons[_ButtonDiscardSnapshot].Visible = false; _Buttons[_ButtonTakeSnapshot].Visible = false; _Buttons[_ButtonWebcam].Visible = false; _SelectElement(_Buttons[_ButtonSave]); } else { CWebcam.Stop(); //Do this first to get consistent frame and bitmap _Snapshot = CWebcam.GetBitmap(); if (CWebcam.GetFrame(ref _WebcamTexture)) { _Statics[_StaticAvatar].Texture = _WebcamTexture; } _Buttons[_ButtonSaveSnapshot].Visible = true; _Buttons[_ButtonDiscardSnapshot].Visible = true; _Buttons[_ButtonTakeSnapshot].Visible = false; _Buttons[_ButtonWebcam].Visible = false; _SelectElement(_Buttons[_ButtonSaveSnapshot]); } }
private void OnTakeSnapshot() { Buttons[htButtons(ButtonSaveSnapshot)].Visible = true; Buttons[htButtons(ButtonDiscardSnapshot)].Visible = true; Buttons[htButtons(ButtonWebcam)].Visible = false; Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; _Snapshot = CWebcam.GetBitmap(); }