mfc怎么用setworldtransform进行旋转
1个回答
展开全部
说下程序思路,用opencv图像显示函数成功在picture control里显示图片,之后添加旋转90度按钮,加入重绘响应Invalidate()到onpaint函数里加入如下代码,为何点击旋转之后图片没有了,求解释,这种思路行不通吗?????多谢大神指点,谢谢!
else if(m_rotate)
{
UpdateData(TRUE);
CDC *pDC = GetDlgItem(IDC_STATIC1)->GetDC(); //图片控件dc
HDC hdc= pDC->GetSafeHdc();
SetGraphicsMode(hdc,GM_ADVANCED);
XFORM xForm;
xForm.eM11 = float(cos(3.1415926 / 2.0));
xForm.eM12 = float(sin(3.1415926 / 2.0));
xForm.eM21 = float(-sin(3.1415926 / 2.0));
xForm.eM22 = float(cos(3.1415926 / 2.0));
else if(m_rotate)
{
UpdateData(TRUE);
CDC *pDC = GetDlgItem(IDC_STATIC1)->GetDC(); //图片控件dc
HDC hdc= pDC->GetSafeHdc();
SetGraphicsMode(hdc,GM_ADVANCED);
XFORM xForm;
xForm.eM11 = float(cos(3.1415926 / 2.0));
xForm.eM12 = float(sin(3.1415926 / 2.0));
xForm.eM21 = float(-sin(3.1415926 / 2.0));
xForm.eM22 = float(cos(3.1415926 / 2.0));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询