seqprocessdlgparameters.cpp

来自「在人脸检测的基础之上,对嘴部的运动表情进行分析,进行语音模拟.」· C++ 代码 · 共 67 行

CPP
67
字号
// SeqProcessDlgParameters.cpp : implementation file
//

#include "stdafx.h"
#include "SeqProcess.h"
#include "SeqProcessDlg.h"
#include "FnMath.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

FnMath fMath;

/////////////////////////////////////////////////////////////////////////

//----------------------------------------------------------------------
void CSeqProcessDlg::OnParametersDisplay() 
{
	m_dlgDisplayParams.m_dispScale = scale;

	if (m_dlgDisplayParams.DoModal() == IDCANCEL)
		return;

	scale = m_dlgDisplayParams.m_dispScale;

	SetWindowPos(NULL, NULL, NULL, MINWINDOWWIDTH, MINWINDOWHEIGHT, SWP_NOMOVE);

	// Compute the size of the required window area
	int widthWindow;
	int heightWindow;

	widthWindow = xPosWindow + scale * m_width; + 20;
	heightWindow = yPosWindow + scale * m_height; + 20 ;
	
	CRect rectC; // Client (display) window
	GetClientRect(&rectC);

	//Find the amount the client area (hence the parent window area)
	//must be increased to cover the image
	int wdiff;
	int hdiff;

	CRect rectW; // Parent window (includes the client window)
	GetWindowRect(&rectW);
	int rectWwidth;
	int rectWheight;
	rectWwidth = (rectW.right - rectW.left);
	rectWheight = (rectW.bottom - rectW.top);

	wdiff = widthWindow - rectC.right;
	hdiff = heightWindow - rectC.bottom;

	//Increase parent window size to cover the required display area
	rectWwidth += (int) fMath.Max(0, wdiff);
	rectWheight += (int) fMath.Max(0, hdiff);
	SetWindowPos(NULL, NULL, NULL, rectWwidth, rectWheight, SWP_NOMOVE);
	
	CClientDC dc(this);
	dc.FillSolidRect( xPosWindow, yPosWindow, rectWwidth, scale*m_height, RGB(192, 192, 192));

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?