Ejemplo n.º 1
0
void CScreenViewWnd::OnLButtonDblClk(UINT nFlags, CPoint point)
{
	CDialog::OnLButtonDblClk(nFlags, point);

	if (!valid_camera(_selectCamera)) {
		return;
	}

	_sync_drawing.Lock();

	_frameQueue.clear();	// frame_buffer clear

	CClientDC dc(this);
	CMemDC MemDC;
	MemDC.CreateDC(&dc, &_bmpCanvas);
	MemDC->FillSolidRect(_rectScreen, RGB(0, 0, 0));
	MemDC.DeleteDC();

	UINT32 cameraList = 0;
	if (_fuse1x1Mode == false) {
		// 1x1 mode setting
		_fuse1x1Mode = true;
		setScreenLayout(ScreenFormatter::LAYOUT_1X1, _selectCamera, _rectScreen);

		// watch for only selected camera
		cameraList |= 1 << _selectCamera;
	}
	else {
		_fuse1x1Mode = false;

		setScreenLayout(_countLiveCamera);

		for (int i = 0; i < _countLiveCamera; ++i) {
			CameraView& rcamera = _cameraView[i];
			if (rcamera.is_visible()) {
				cameraList |= 1 << i;
			}
		}
	}

	_sync_drawing.Unlock();

	CWnd* lpParent = GetParent();
	if (lpParent != NULL &&
		lpParent->GetSafeHwnd()) {
		lpParent->PostMessage(UM_SCREEN_DBLCLICK,
							  static_cast<WPARAM>(cameraList),
							  static_cast<LPARAM>(MAX_CAMERA_COUNTS));
	}

	Invalidate(FALSE);
}
Ejemplo n.º 2
0
void CScreenViewWnd::clearScreen()
{
	_sync_drawing.Lock();

	for (int i = 0; i < _countCamera; i++) {
		_cameraView[i].resetCamera();
	}

	_selectCamera = -1;
	_countLiveCamera = __min(_countCamera, 16);

	CDC* pDC = GetDC();
	CMemDC MemDC;
	MemDC.CreateDC(pDC, &_bmpCanvas);
	MemDC->FillSolidRect(_rectScreen, RGB(0, 0, 0));
	MemDC.DeleteDC();
	ReleaseDC(pDC);

	_sync_drawing.Unlock();

	Invalidate(TRUE);
}