code mistake

void CProcessBar::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CImageProcessDoc *pDoc=(CImageProcessDoc *)GetDocument(RUNTIME_CLASS(CImageProcessDoc));
UpdateData(TRUE);
int nSizePos=m_slider_size.GetPos();
m_size_value=nSizePos;
m_size_ratio.Format(_T("%d%%"),m_size_value);
GetDlgItem(IDC_SIZE_RATIO)->SetWindowText(m_size_ratio);

CvvImage img_resize;
img_resize.Create(pDoc->img.Width()*m_size_value*20,pDoc->img.Height()*m_size_value*20,pDoc->img.Bpp());
cvResize(pDoc->img.GetImage(),img_resize.GetImage(),CV_INTER_LINEAR);
pDoc->img.Destroy();
pDoc->img.CopyOf(img_resize);

CDialogBar::OnHScroll(nSBCode, nPos, pScrollBar);
}

posted on 2012-02-08 22:39  伪君  阅读(134)  评论(0编辑  收藏  举报

导航